use of javafx.embed.swing.JFXPanel in project ETUmulator by kasirgalabs.
the class GUISafeDispatcherTest method testNotifyObservers.
/**
* Test of notifyObservers method, of class GUISafeDispatcher.
*
* @throws java.lang.InterruptedException
*/
@Test
public void testNotifyObservers() throws InterruptedException {
assert !Platform.isFxApplicationThread();
new JFXPanel();
dispatcher.addObserver(this);
latch = new CountDownLatch(1);
dispatcher.notifyObservers(null);
latch.await(5, TimeUnit.SECONDS);
}
use of javafx.embed.swing.JFXPanel in project contentment by GeePawHill.
the class ContentmentTest method runJavaFx.
protected void runJavaFx() throws InterruptedException {
if (javaFxRunning)
return;
long timeMillis = System.currentTimeMillis();
final CountDownLatch latch = new CountDownLatch(1);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
forceJavaFxStart();
latch.countDown();
}
private void forceJavaFxStart() {
new JFXPanel();
}
});
System.out.println("javafx initialising...");
latch.await();
System.out.println("javafx is initialised in " + (System.currentTimeMillis() - timeMillis) + "ms");
javaFxRunning = true;
}
use of javafx.embed.swing.JFXPanel in project gs-ui-javafx by graphstream.
the class FxFileSinkImages method initImage.
@Override
protected void initImage() {
//
// Little hack to initialize JavaFX Toolkit.
//
new JFXPanel();
image = new WritableImage(resolution.getWidth(), resolution.getHeight());
canvas = new Canvas(resolution.getWidth(), resolution.getHeight());
}
use of javafx.embed.swing.JFXPanel in project BlocklyArduinoIDEPlugin by technologiescollege.
the class LedMatrixPlugin method initGUI.
private void initGUI() {
window = new JFrame();
window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
window.setLayout(new BorderLayout());
window.setSize(1024, 768);
window.setLocationRelativeTo(null);
window.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
SwingUtilities.invokeLater(() -> {
Platform.runLater(() -> {
// browser.webEngine.load("about:blank");
SwingUtilities.invokeLater(() -> {
// System.out.println("test");
try {
e.getWindow().dispose();
} catch (NullPointerException ex) {
// System.out.println("This is a bug in java: https://bugs.openjdk.java.net/browse/JDK-8089371");
}
});
});
});
}
});
jfxPanel = new JFXPanel();
jfxPanel.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT));
window.add(jfxPanel, BorderLayout.CENTER);
window.setVisible(true);
Platform.runLater(() -> {
showBrowser();
});
}
use of javafx.embed.swing.JFXPanel in project BlocklyArduinoIDEPlugin by technologiescollege.
the class StartupApplet method init.
@Override
public void init() {
LedMatrixPlugin.startTimestamp = System.currentTimeMillis();
fxContainer = new JFXPanel();
fxContainer.setPreferredSize(new Dimension(JFXPANEL_WIDTH_INT, JFXPANEL_HEIGHT_INT));
add(fxContainer, BorderLayout.CENTER);
Platform.setImplicitExit(false);
Runnable activeRunnable = new Runnable() {
@Override
public void run() {
createScene();
}
};
Platform.runLater(activeRunnable);
}
Aggregations