Java Code Examples for javafx.embed.swing.JFXPanel

The following examples show how to use javafx.embed.swing.JFXPanel. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: netbeans   Source File: ComponentsTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test(timeOut = 9000)
public void loadFX() throws Exception {
    final CountDownLatch cdl = new CountDownLatch(1);
    final CountDownLatch done = new CountDownLatch(1);
    final JFXPanel p = new JFXPanel();
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            Node wv = TestPages.getFX(10, cdl);
            Scene s = new Scene(new Group(wv));
            p.setScene(s);
            done.countDown();
        }
    });
    done.await();
    JFrame f = new JFrame();
    f.getContentPane().add(p);
    f.pack();
    f.setVisible(true);
    cdl.await();
}
 
Example 2
Source Project: netbeans   Source File: DialogsTest.java    License: Apache License 2.0 6 votes vote down vote up
@BeforeClass(timeOut = 9000)
public static void initializeContext() throws Exception {
    final JFXPanel p = new JFXPanel();
    final URL u = DialogsTest.class.getResource("/org/netbeans/api/htmlui/empty.html");
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            WebView v = new WebView();
            Scene s = new Scene(v);
            p.setScene(s);
            HtmlToolkit.getDefault().load(v, u, new Runnable() {
                @Override
                public void run() {
                    ctx = BrwsrCtx.findDefault(DialogsTest.class);
                    down.countDown();
                }
            }, null);
        }
    });
    down.await();
    JFrame f = new JFrame();
    f.getContentPane().add(p);
    f.pack();
    f.setVisible(true);
}
 
Example 3
Source Project: Rails   Source File: StockChartWindow.java    License: GNU General Public License v2.0 6 votes vote down vote up
public StockChartWindow(GameUIManager gameUIManager) {
    final JFXPanel fxPanel = new JFXPanel();
    add(fxPanel);
    setTitle("Rails: Stock Chart");
    setPreferredSize(new Dimension(600, 400));
    setVisible(true);
    setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);

    final JFrame frame = this;
    addWindowListener(new WindowAdapter() {
        @Override
        public void windowClosing(WindowEvent e) {
            gameUIManager.uncheckMenuItemBox(StatusWindow.REPORT_CMD);
            frame.dispose();
        }
    });

    Platform.runLater(() -> {
        Scene scene = new Scene(new FXStockChart(gameUIManager));
        fxPanel.setScene(scene);
        frame.pack();
    });
}
 
Example 4
Source Project: megan-ce   Source File: SamplesTableView.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * initialize JavaFX
 *
 * @param jfxPanel
 */
private void initFxLater(JFXPanel jfxPanel) {
    if (!initialized) {
        if (Thread.getDefaultUncaughtExceptionHandler() != fxExceptionHandler)
            Thread.setDefaultUncaughtExceptionHandler(fxExceptionHandler);
        synchronized (lock) {
            if (!initialized) {
                try {
                    final BorderPane rootNode = new BorderPane();
                    jfxPanel.setScene(new Scene(rootNode, 600, 600));

                    final Node main = createMainNode();
                    rootNode.setCenter(main);
                    BorderPane.setMargin(main, new Insets(3, 3, 3, 3));

                    // String css = NotificationsInSwing.getControlStylesheetURL();
                    // if (css != null)
                    //    jfxPanel.getScene().getStylesheets().add(css);
                } finally {
                    initialized = true;
                }
            }
        }
    }
}
 
Example 5
public WebContentFXPanel() {

        Platform.setImplicitExit(false);
        panel = new JFXPanel();
        setContent(panel);

        String actualUrl = url;
        try {
            HttpClient httpclient = new DefaultHttpClient();
            HttpGet httpget = new HttpGet(url);
            HttpResponse response = httpclient.execute(httpget);
            if (response.getStatusLine().getStatusCode() != 200) {
                actualUrl = altUrl;
            }
        } catch(IOException e) {
            // Ignore
        }
        final String targetUrl = actualUrl;
        Platform.runLater(() -> {
            initFX(targetUrl);
        });
    }
 
Example 6
Source Project: mars-sim   Source File: FXInSwing.java    License: GNU General Public License v3.0 6 votes vote down vote up
public FXInSwing(){
    panel = new JFXPanel();
    Platform.runLater(new Runnable(){
        @Override
        public void run() {
            stack = new StackPane();
            scene = new Scene(stack,300,300);
            hello = new Text("Hello");

            scene.setFill(Color.BLACK);
            hello.setFill(Color.WHEAT);
            hello.setEffect(new Reflection());

            panel.setScene(scene);
            stack.getChildren().add(hello);

            wait = false;
        }
    });
    this.getContentPane().add(panel);
    this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    this.setSize(300, 300);
    this.setVisible(true);
}
 
Example 7
Source Project: mars-sim   Source File: SwingDialog.java    License: GNU General Public License v3.0 6 votes vote down vote up
private JFXPanel createJFXPanel(){
    final JFXPanelEx panel = new JFXPanelEx();
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            final VBox vbox = new VBox();
            final ComboBox<String> combo = new ComboBox<String>();
            for (int i = 0; i< 101; i++){
                combo.getItems().add("text" + i);
            }
            vbox.getChildren().addAll(combo);
            final Scene scene = new Scene(vbox);
            panel.setScene(scene);
        };
    });
    return panel;
}
 
Example 8
Source Project: mars-sim   Source File: SwingDialog.java    License: GNU General Public License v3.0 6 votes vote down vote up
private JFXPanel createJFXPanel0(){
    final JFXPanel panel = new JFXPanel();
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            final VBox vbox = new VBox();
            final ComboBox<String> combo = new ComboBox<String>();
            for (int i = 0; i< 101; i++){
                combo.getItems().add("text" + i);
            }
            vbox.getChildren().addAll(combo);
            final Scene scene = new Scene(vbox);
            panel.setScene(scene);
        };
    });
    return panel;
}
 
Example 9
Source Project: mars-sim   Source File: SwingFXWebView.java    License: GNU General Public License v3.0 6 votes vote down vote up
private void initComponents(){

        jfxPanel = new JFXPanel();
        createScene();

        setLayout(new BorderLayout());
        add(jfxPanel, BorderLayout.CENTER);

        swingButton = new JButton();
        swingButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Platform.runLater(new Runnable() {

                    @Override
                    public void run() {
                        webEngine.reload();
                    }
                });
            }
        });
        swingButton.setText("Reload");

        add(swingButton, BorderLayout.SOUTH);
    }
 
Example 10
Source Project: opencards   Source File: SwingFXWebView.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
private void initComponents() {

        jfxPanel = new JFXPanel();
        createScene();

        setLayout(new BorderLayout());
        add(jfxPanel, BorderLayout.CENTER);

        swingButton = new JButton();
        swingButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                Platform.runLater(new Runnable() {

                    @Override
                    public void run() {
                        webEngine.reload();
                    }
                });
            }
        });
        swingButton.setText("Reload");

        add(swingButton, BorderLayout.SOUTH);
    }
 
Example 11
Source Project: pcgen   Source File: PCGenFrame.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private void initComponents()
{
	setLayout(new BorderLayout());

	JComponent root = getRootPane();
	root.setActionMap(actionMap);
	root.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, createInputMap(actionMap));

	characterTabs.add(new InfoGuidePane(this, uiContext));

	setJMenuBar(pcGenMenuBar);
	PCGenToolBar pcGenToolBar = new PCGenToolBar(this);
	ToolBar toolBar = pcGenToolBar.buildMenu();
	JFXPanel wrappedToolBar = GuiUtility.wrapParentAsJFXPanel(toolBar);

	add(wrappedToolBar, BorderLayout.NORTH);
	add(characterTabs, BorderLayout.CENTER);
	add(statusBar, BorderLayout.SOUTH);
	updateTitle();
	setIconImage(Icons.PCGenApp.getImageIcon().getImage());
}
 
Example 12
Source Project: pcgen   Source File: PCGenStatusBar.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
PCGenStatusBar(PCGenFrame frame)
{
	this.frame = frame;
	this.messageLabel = new JLabel();
	this.progressBar = new JProgressBar();
	this.loadStatusButton = new Button();

	setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
	add(messageLabel);
	add(Box.createHorizontalGlue());
	progressBar.setStringPainted(true);
	progressBar.setVisible(false);
	add(progressBar);
	add(Box.createHorizontalGlue());
	JFXPanel wrappedButton = GuiUtility.wrapParentAsJFXPanel(loadStatusButton);
	//todo: calculate this rather than hard code
	wrappedButton.setMaximumSize(new Dimension(750, 20000000));
	add(wrappedButton);
	loadStatusButton.setOnAction(this::loadStatusLabelAction);
}
 
Example 13
Source Project: pcgen   Source File: Main.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private static void startupWithGUI()
{
	// configure the UI before any type of user prompting may take place
	configureUI();
	validateEnvironment(true);
	loadProperties(true);
	initPrintPreviewFonts();

	new JFXPanel();

	PCGenPreloader splash = new PCGenPreloader();
	PCGenTaskExecutor executor = new PCGenTaskExecutor();
	executor.addPCGenTask(createLoadPluginTask());
	executor.addPCGenTask(new GameModeFileLoader());
	executor.addPCGenTask(new CampaignFileLoader());
	executor.addPCGenTaskListener(splash);
	executor.run();
	splash.getController().setProgress(LanguageBundle.getString("in_taskInitUi"), 1.0d);
	FacadeFactory.initialize();
	PCGenUIManager.initializeGUI();
	splash.done();
	PCGenUIManager.startGUI();
}
 
Example 14
Source Project: TweetwallFX   Source File: Main.java    License: MIT License 6 votes vote down vote up
public static void main(String[] args) {
    final JPanel panel = new JPanel();
    panel.setLayout(new BorderLayout());

    queryTextfield = new JTextField("#javaone");
    tweetwall = new EmbeddedTweetwall();

    final JFXPanel p = new JFXPanel();
    p.setScene(new Scene(new BorderPane(tweetwall)));

    queryTextfield.addActionListener(e -> {
        stop();
        start(queryTextfield.getText());
    });

    panel.add(queryTextfield, BorderLayout.NORTH);
    panel.add(p, BorderLayout.CENTER);

    JFrame jFrame = new JFrame("Hi there");
    jFrame.setContentPane(panel);
    jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    jFrame.setSize(1024, 768);
    jFrame.setVisible(true);
}
 
Example 15
Source Project: BotLibre   Source File: VideoView.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public void setVideoView() {
	Platform.runLater(new Runnable() {

		@Override
		public void run() {

			final DoubleProperty width = mediaView.fitWidthProperty();
			final DoubleProperty height = mediaView.fitHeightProperty();
			width.bind(Bindings.selectDouble(mediaView.sceneProperty(), "width"));
			height.bind(Bindings.selectDouble(mediaView.sceneProperty(), "height"));
			BorderPane borderPane = new BorderPane();
			borderPane.setCenter(mediaView);
			final Scene scene = new Scene(borderPane, Color.WHITE);
			((JFXPanel) VideoView.jfx).setScene(scene);

		}
	});
	this.component = jfx;
}
 
Example 16
Source Project: BotLibre   Source File: VideoView.java    License: Eclipse Public License 1.0 6 votes vote down vote up
public void setVideoView() {
	Platform.runLater(new Runnable() {

		@Override
		public void run() {

			final DoubleProperty width = mediaView.fitWidthProperty();
			final DoubleProperty height = mediaView.fitHeightProperty();
			width.bind(Bindings.selectDouble(mediaView.sceneProperty(), "width"));
			height.bind(Bindings.selectDouble(mediaView.sceneProperty(), "height"));
			BorderPane borderPane = new BorderPane();
			borderPane.setCenter(mediaView);
			final Scene scene = new Scene(borderPane, Color.WHITE);
			((JFXPanel) VideoView.jfx).setScene(scene);

		}
	});
	this.component = jfx;
}
 
Example 17
public FXBrowserWindowSE(String startURL) {
    try {
        initUI(startURL);
    } catch (IllegalStateException ex) {
        try {
            EventQueue.invokeAndWait(new Runnable() {
                @Override
                public void run() {
                    new JFXPanel();
                }

            });
        } catch (InterruptedException iex) {
            Log.e(iex);
            throw ex;
        } catch (InvocationTargetException ite) {
            Log.e(ite);
            throw ex;
        }
        initUI(startURL);
    }
}
 
Example 18
Source Project: graph-editor   Source File: JavaFXThreadingRule.java    License: Eclipse Public License 1.0 6 votes vote down vote up
protected void setupJavaFX() throws InterruptedException {
    final CountDownLatch latch = new CountDownLatch(1);
    javax.swing.SwingUtilities.invokeLater(new Runnable() {
        @Override
        public void run() {
            try {
                // initializes JavaFX environment
                new JFXPanel();
            } finally {
                // always invoke countDown(), because otherwise the main thread will hang.
                latch.countDown();
            }
        }
    });
    latch.await();
}
 
Example 19
Source Project: pcgen   Source File: PCGenFrame.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private void initComponents()
{
	setLayout(new BorderLayout());

	JComponent root = getRootPane();
	root.setActionMap(actionMap);
	root.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, createInputMap(actionMap));

	characterTabs.add(new InfoGuidePane(this, uiContext));

	setJMenuBar(pcGenMenuBar);
	PCGenToolBar pcGenToolBar = new PCGenToolBar(this);
	ToolBar toolBar = pcGenToolBar.buildMenu();
	JFXPanel wrappedToolBar = GuiUtility.wrapParentAsJFXPanel(toolBar);

	add(wrappedToolBar, BorderLayout.NORTH);
	add(characterTabs, BorderLayout.CENTER);
	add(statusBar, BorderLayout.SOUTH);
	updateTitle();
	setIconImage(Icons.PCGenApp.getImageIcon().getImage());
}
 
Example 20
Source Project: pcgen   Source File: PCGenStatusBar.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
PCGenStatusBar(PCGenFrame frame)
{
	this.frame = frame;
	this.messageLabel = new JLabel();
	this.progressBar = new JProgressBar();
	this.loadStatusButton = new Button();

	setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS));
	add(messageLabel);
	add(Box.createHorizontalGlue());
	progressBar.setStringPainted(true);
	progressBar.setVisible(false);
	add(progressBar);
	add(Box.createHorizontalGlue());
	JFXPanel wrappedButton = GuiUtility.wrapParentAsJFXPanel(loadStatusButton);
	//todo: calculate this rather than hard code
	wrappedButton.setMaximumSize(new Dimension(750, 20000000));
	add(wrappedButton);
	loadStatusButton.setOnAction(this::loadStatusLabelAction);
}
 
Example 21
Source Project: pcgen   Source File: Main.java    License: GNU Lesser General Public License v2.1 6 votes vote down vote up
private static void startupWithGUI()
{
	// configure the UI before any type of user prompting may take place
	configureUI();
	validateEnvironment(true);
	loadProperties(true);
	initPrintPreviewFonts();

	new JFXPanel();

	PCGenPreloader splash = new PCGenPreloader();
	PCGenTaskExecutor executor = new PCGenTaskExecutor();
	executor.addPCGenTask(createLoadPluginTask());
	executor.addPCGenTask(new GameModeFileLoader());
	executor.addPCGenTask(new CampaignFileLoader());
	executor.addPCGenTaskListener(splash);
	executor.run();
	splash.getController().setProgress(LanguageBundle.getString("in_taskInitUi"), 1.0d);
	FacadeFactory.initialize();
	PCGenUIManager.initializeGUI();
	splash.done();
	PCGenUIManager.startGUI();
}
 
Example 22
Source Project: PeerWasp   Source File: JavaFXThreadingRule.java    License: MIT License 6 votes vote down vote up
protected void setupJavaFX() throws InterruptedException {

            long timeMillis = System.currentTimeMillis();

            final CountDownLatch latch = new CountDownLatch(1);

            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    // initializes JavaFX environment
                    new JFXPanel();

                    latch.countDown();
                }
            });

            logger.info("javafx initialising...");
            latch.await();
            logger.info("javafx is initialised in " + (System.currentTimeMillis() - timeMillis) + "ms");
        }
 
Example 23
Source Project: constellation   Source File: PluginParametersSwingDialog.java    License: Apache License 2.0 5 votes vote down vote up
/**
     * Display a dialog box containing the parameters that allows the user to
     * enter values.
     * <p>
     * "OK" and "Cancel" (and "Help" if helpID is non-null) buttons are
     * displayed.
     *
     * @param title The dialog box title.
     * @param parameters The plugin parameters.
     * @param excludedParameters Plugin parameters to exclude from the dialog
     * box.
     * @param helpID The JavaHelp ID of the help.
     */
    public PluginParametersSwingDialog(final String title, final PluginParameters parameters, final Set<String> excludedParameters, final String helpID) {
//        if(!SwingUtilities.isEventDispatchThread())
//        {
//            throw new IllegalStateException("Not event dispatch thread");
//        }

        this.title = title;

        final CountDownLatch latch = new CountDownLatch(1);
        xp = helpID != null ? new JFXPanelWithHelp(helpID) : new JFXPanel();
        Platform.runLater(() -> {
            final BorderPane root = new BorderPane();
            root.setPadding(new Insets(10));
            root.setStyle("-fx-background-color: #DDDDDD;");

            // Attempt to give the window a sensible width and/or height.
            root.setMinWidth(500);

            final PluginParametersPane parametersPane = PluginParametersPane.buildPane(parameters, null, excludedParameters);
            root.setCenter(parametersPane);
            final Scene scene = new Scene(root);
            xp.setScene(scene);
            xp.setPreferredSize(new Dimension((int) scene.getWidth(), (int) scene.getHeight()));
            latch.countDown();
        });

        try {
            latch.await();
        } catch (InterruptedException ex) {
            Exceptions.printStackTrace(ex);
            Thread.currentThread().interrupt();
        }
    }
 
Example 24
Source Project: aurous-app   Source File: AurousFrame.java    License: GNU General Public License v2.0 5 votes vote down vote up
private void initFX(final JFXPanel fxPanel) throws Throwable {
	// This method is invoked on the JavaFX thread
	final MediaPlayerScene mediaPlayerScene = new MediaPlayerScene();
	UISession.setMediaPlayerScene(mediaPlayerScene);
	scene = UISession.getMediaPlayerScene().createScene(
			"https://www.youtube.com/watch?v=kGubD7KG9FQ");
	setScene(scene);
	fxPanel.setScene(scene);
	UISession.setJFXPanel(fxPanel);

}
 
Example 25
Source Project: Weather-Forecast   Source File: JFxBuilder.java    License: Apache License 2.0 5 votes vote down vote up
private void initAndShowGUI() {
    final JFXPanel fxPanel = new JFXPanel();
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            initFX(fxPanel);
            if (Dialog != null) {
                createAlertDialog(Dialog);
            }
        }
    });

}
 
Example 26
Source Project: netbeans   Source File: JavaFxHtmlToolkit.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public Object initHtmlComponent(JComponent c, Consumer<String> titleDisplayer) {
    JFXPanel p = (JFXPanel) c;
    Platform.setImplicitExit(false);
    WebView webView = new WebView();
    BorderPane bp = new BorderPane();
    Scene scene = new Scene(bp, Color.ALICEBLUE);

    class X implements ChangeListener<String>, Runnable {

        private String title;

        public X() {
            super();
        }

        @Override
        public void changed(ObservableValue<? extends String> ov, String t, String t1) {
            title = webView.getEngine().getTitle();
            EventQueue.invokeLater(this);
        }

        @Override
        public void run() {
            if (title != null) {
                titleDisplayer.accept(title);
            }
        }
    }
    final X x = new X();
    webView.getEngine().titleProperty().addListener(x);
    HtmlToolkit.getDefault().execute(x);
    bp.setCenter(webView);
    p.setScene(scene);
    return webView;
}
 
Example 27
Source Project: netbeans   Source File: ShowDialogFromFXThreadTest.java    License: Apache License 2.0 5 votes vote down vote up
@BeforeClass(timeOut = 9000)
public static void initFX() {
    JFXPanel p = new JFXPanel();
    JFrame f = new JFrame();
    f.getContentPane().add(p);
    f.setVisible(true);
}
 
Example 28
public static void main(final String[] args) throws Exception {

		ILabeledDataset<?> ds = OpenMLDatasetReader.deserializeDataset(3);
		List<ILabeledDataset<?>> split = SplitterUtil.getLabelStratifiedTrainTestSplit(ds, new Random(0), .7);

		/* initialize mlplan, and let it run for 30 seconds */
		MLPlanSimpleBuilder builder = new MLPlanSimpleBuilder();
		builder.withNodeEvaluationTimeOut(new Timeout(10, TimeUnit.SECONDS));
		builder.withCandidateEvaluationTimeOut(new Timeout(5, TimeUnit.SECONDS));
		builder.withTimeOut(new Timeout(30, TimeUnit.SECONDS));
		builder.withNumCpus(1);

		MLPlan<IClassifier> mlplan = builder.withDataset(split.get(0)).build();
		mlplan.setRandomSeed(1);
		mlplan.setPortionOfDataForPhase2(.3f);
		mlplan.setLoggerName("testedalgorithm");

		/* start visualization */
		new JFXPanel();
		AlgorithmVisualizationWindow window = new AlgorithmVisualizationWindow(mlplan);
		window.withMainPlugin(new GraphViewPlugin());
		window.withPlugin(new NodeInfoGUIPlugin(new JaicoreNodeInfoGenerator<>(new TFDNodeInfoGenerator())), new SearchRolloutHistogramPlugin(), new OutOfSampleErrorPlotPlugin(split.get(0), split.get(1)));

		try {
			long start = System.currentTimeMillis();
			IClassifier optimizedClassifier = mlplan.call();
			long trainTime = (int) (System.currentTimeMillis() - start) / 1000;
			System.out.println("Finished build of the classifier. Training time was " + trainTime + "s.");

			/* evaluate solution produced by mlplan */
			System.out.println("Error Rate of the solution produced by ML-Plan: " + MLEvaluationUtil.getLossForTrainedClassifier(optimizedClassifier, split.get(1), EClassificationPerformanceMeasure.ERRORRATE));
		} catch (NoSuchElementException e) {
			System.out.println("Building the classifier failed: " + e.getMessage());
		}
	}
 
Example 29
private void setup(final AlgorithmEventHistory algorithmEventHistory) {
	new JFXPanel(); // dummy to initialize JavaFX if this has not happened before

	/* define event sources */
	this.algorithmEventHistory = algorithmEventHistory;
	this.algorithmEventHistoryPuller = new AlgorithmEventHistoryEntryDeliverer(algorithmEventHistory);
	this.algorithmEventSource = this.algorithmEventHistoryPuller;

	/* initialize controls and launch the window */
	this.initializeControls();
	DefaultGUIEventBus.getInstance().registerListener(this.algorithmEventHistoryPuller);
	Platform.runLater(this);
}
 
Example 30
Source Project: megan-ce   Source File: SamplesTableView.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * get the panel
 *
 * @return panel
 */
public JFXPanel getPanel() {
    for (int count = 0; count < 100; count++) {
        if (initialized)
            break;
        try {
            Thread.sleep(10);
        } catch (InterruptedException e) {
            Basic.caught(e);
        }
    }
    return jFXPanel;
}