Search in sources :

Example 6 with MainPanel

use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.

the class SwingPopupSwingParentSwing method main.

public static void main(String[] args) {
    UiCore.startSwing(() -> new MainPanel());
    final JDialog d = new JDialog(SwingCore.mainFrame(), "ExtraDialog", Dialog.ModalityType.MODELESS);
    Label label = new Label("Ein extra Dialog");
    d.getContentPane().add(label);
    d.pack();
    d.setLocation(500, 500);
    d.setVisible(true);
    String adress = "Hans Mustermann\nMusterstrasse 22\n12345 Musterhausen";
    // Swing Panel in Swing Dialog
    Ui.exec(() -> {
        Ui.build(label).swing().eval(() -> adress, () -> new DocumentAdressUpdateViewOkCanceler()).opt().ifPresent(System.out::println);
    });
}
Also used : MainPanel(eu.ggnet.saft.sample.support.MainPanel) Label(java.awt.Label) JDialog(javax.swing.JDialog) DocumentAdressUpdateViewOkCanceler(eu.ggnet.saft.sample.support.DocumentAdressUpdateViewOkCanceler)

Example 7 with MainPanel

use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.

the class FileHandling method main.

public static void main(String[] args) {
    UiCore.startSwing(() -> new MainPanel());
    Ui.exec(() -> {
        Ui.fileChooser().open().opt().ifPresent(f -> System.out.println("Ok pressed, File: " + f.getAbsolutePath()));
    });
}
Also used : MainPanel(eu.ggnet.saft.sample.support.MainPanel)

Example 8 with MainPanel

use of eu.ggnet.saft.sample.support.MainPanel in project dwoss by gg-net.

the class FileOsOpen method main.

public static void main(String[] args) {
    UiCore.startSwing(() -> new MainPanel());
    // New Stype
    Ui.exec(() -> {
        Ui.fileChooser().title("Bitte Datei auswählen, die das Betriebsystem öffnen kann").open().opt().ifPresent(file -> Ui.osOpen(file));
    });
// Old style
// Ui.exec(Ui.openFileChooser("Bitte Datei auswählen, die das Betriebsystem öffnen kann")
// .onOk(f -> f) // Push value though.
// .osOpen()
// );
}
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