All Classes Namespaces Files Functions Variables
InputMain.java
Go to the documentation of this file.
1 package fxguiDialogs;
2 import fi.jyu.mit.fxgui.Dialogs;
3 import javafx.application.Application;
4 import javafx.stage.Stage;
5 
6 @SuppressWarnings("javadoc")
7 public class InputMain extends Application {
8  @Override
9  public void start(Stage primaryStage) {
10  String kerhonNimi = Dialogs.showInputDialog("Anna kerhon nimi", "kelmit",
11  dlg -> dlg.getDialogPane().setPrefWidth(400));
12  if ( kerhonNimi != null ) {
13  boolean tallennetaan = Dialogs.showQuestionDialog(
14  "Kysymys", "Tallennetaanko " + kerhonNimi, "Kyllä", "Ei",
15  dlg -> dlg.getDialogPane().setPrefWidth(200));
16  Dialogs.showMessageDialog(kerhonNimi + " " + tallennetaan,
17  dlg -> dlg.getDialogPane().setPrefWidth(400));
18  }
19  }
20 
21  public static void main(String[] args) { launch(args); }
22 }