2 import javafx.application.Application;
3 import javafx.stage.Stage;
4 import javafx.scene.Scene;
5 import javafx.scene.control.TextInputDialog;
6 import javafx.scene.layout.BorderPane;
8 import java.util.Optional;
11 @SuppressWarnings(
"javadoc")
14 public void start(Stage stage) {
15 BorderPane root =
new BorderPane();
16 Scene scene =
new Scene(root, 400, 400);
17 stage.setScene(scene);
18 stage.setTitle(
"BorderPane");
21 TextInputDialog dialog =
new TextInputDialog(
"kelmit");
22 dialog.setHeaderText(null);
23 dialog.setTitle(
"Vastaa");
24 dialog.setContentText(
"Kerhon nimi:");
25 Optional<String> answer = dialog.showAndWait();
26 System.out.println(answer.isPresent() ? answer.get() :
"Ei ollut vastausta");
29 public static void main(String[] args) { launch(args); }