Search in sources :

Example 1 with MainPanel

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);
    });
}
Also used : GridPane(javafx.scene.layout.GridPane) Insets(javafx.geometry.Insets) MainPanel(eu.ggnet.saft.sample.support.MainPanel)

Example 2 with MainPanel

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);
    });
}
Also used : MainPanel(eu.ggnet.saft.sample.support.MainPanel)

Example 3 with MainPanel

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();
}
Also used : MainPanel(eu.ggnet.saft.sample.support.MainPanel)

Example 4 with MainPanel

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");
    });
}
Also used : MainPanel(eu.ggnet.saft.sample.support.MainPanel)

Example 5 with MainPanel

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");
    });
}
Also used : MainPanel(eu.ggnet.saft.sample.support.MainPanel)

Aggregations

MainPanel (eu.ggnet.saft.sample.support.MainPanel)8 DocumentAdressUpdateViewOkCanceler (eu.ggnet.saft.sample.support.DocumentAdressUpdateViewOkCanceler)1 Label (java.awt.Label)1 Insets (javafx.geometry.Insets)1 GridPane (javafx.scene.layout.GridPane)1 JDialog (javax.swing.JDialog)1