During the conversion to JavaFX we have a mix of JavaFX and Swing components This provides a way to convert from JavaFX to Swing. Note that the painting happens "eventually" and thus when the function returned there is no guarantee that the component has any size yet. @param parent a javafx Parent t
(Parent parent)
| 41 | * @return a jfxpanel that eventually gets painted as the parent container |
| 42 | */ |
| 43 | public static JFXPanel wrapParentAsJFXPanel(Parent parent) |
| 44 | { |
| 45 | GuiAssertions.assertIsNotJavaFXThread(); |
| 46 | JFXPanel jfxPanel = new JFXPanel(); |
| 47 | Platform.runLater(() -> { |
| 48 | Scene scene = new Scene(parent); |
| 49 | jfxPanel.setScene(scene); |
| 50 | }); |
| 51 | return jfxPanel; |
| 52 | } |
| 53 | |
| 54 | public static <T> T runOnJavaFXThreadNow(Supplier<T> supplier) |
| 55 | { |
no test coverage detected