use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.
the class SwingJavaFxDialog method main.
public static void main(String[] args) {
Ui.exec(() -> {
UiCore.startSwing(() -> new MainPanel());
Ui.build().dialog().eval(() -> {
Dialog<String> dialog = new Dialog<>();
GridPane grid = new GridPane();
grid.setHgap(10);
grid.setVgap(10);
grid.setPadding(new Insets(20, 150, 10, 10));
TextField username = new TextField();
username.setPromptText("Username");
grid.add(new Label("Username:"), 0, 0);
grid.add(username, 1, 0);
dialog.setResultConverter(buttonType -> {
if (buttonType.equals(OK))
return username.getText();
return null;
});
dialog.getDialogPane().setContent(grid);
dialog.getDialogPane().getButtonTypes().addAll(OK, CANCEL);
return dialog;
}).opt().ifPresent(System.out::println);
});
}
use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.
the class SwingPopupJavaFxParentJavaFx method main.
public static void main(String[] args) throws InterruptedException, ExecutionException {
UiCore.startSwing(() -> new MainPanel());
// JavaFX Pane in Swing Dialog.
Ui.exec(() -> {
Ui.build().fx().eval(() -> new TestPane()).opt().ifPresent(System.out::println);
});
}
use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.
the class AsyncRunThenPopUp method main.
public static void main(String[] args) {
final MainPanel panel = new MainPanel();
UiCore.startSwing(() -> panel);
UiCore.backgroundActivityProperty().addListener((o, ov, nv) -> {
EventQueue.invokeLater(() -> {
panel.getProgressBar().setIndeterminate(nv);
});
});
saftNew();
}
use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.
the class OverwriteExceptions method main.
public static void main(String[] args) {
UiCore.startSwing(() -> new MainPanel());
UiCore.registerExceptionConsumer(IllegalArgumentException.class, (t) -> {
Ui.build().alert("Important:" + t.getClass().getSimpleName() + " : " + t.getMessage());
});
Ui.exec(() -> {
throw new IllegalArgumentException("Sinnlos");
});
}
use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.
the class SimpleException method main.
public static void main(String[] args) {
UiCore.startSwing(() -> new MainPanel());
Ui.exec(() -> {
throw new IllegalAccessException("Sinnlos");
});
}