use of eu.ggnet.saft.runtime.SwingClient in project dwoss by gg-net.
the class ClientTryout method tryout.
@Test
public void tryout() throws InterruptedException {
JFXPanel p = new JFXPanel();
CountDownLatch cdl = new CountDownLatch(1);
final SwingClient ac = new SwingClient() {
@Override
protected void close() {
System.out.println("closing");
cdl.countDown();
}
};
ac.init();
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
ac.show("Tryout", null);
}
});
cdl.await();
}
use of eu.ggnet.saft.runtime.SwingClient in project dwoss by gg-net.
the class RunClientFx method init.
@Override
public void init() throws Exception {
LoggerFactory.getLogger(RunClientFx.class).info("JavaFx init");
System.out.println("JavaFx init");
String key = discoverConfigParameters();
// Go to default, but inform on console abaout usage.
if (!Configurations.containsConfig(key))
usage(key);
lookupConfig = Configurations.getConfigOrDefault(key);
WildflyLookup wildflyLookup = new WildflyLookup(lookupConfig);
Dl.local().add(RemoteLookup.class, wildflyLookup);
Toolkit.getDefaultToolkit().getSystemEventQueue().push(new UnhandledExceptionCatcher());
UiCore.overwriteFinalExceptionConsumer(new DwFinalExceptionConsumer());
UiCore.registerExceptionConsumer(UserInfoException.class, new UserInfoExceptionConsumer());
UiCore.registerExceptionConsumer(ConstraintViolationException.class, new ConstraintViolationConsumer());
verifyRemoteConnection();
EventQueue.invokeAndWait(() -> {
swingClient = new SwingClient() {
@Override
protected void close() {
System.out.println("Calling Close");
Platform.exit();
// Again, not perfect, but otherwise the application dosen't close and I don't know why yet.
System.exit(0);
}
};
swingClient.init();
});
}
Aggregations