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);
});
}
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()));
});
}
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()
// );
}