1 import javafx.application.Application;
2 import javafx.geometry.Insets;
3 import javafx.scene.Scene;
4 import javafx.scene.control.Label;
5 import javafx.scene.control.TextField;
6 import javafx.scene.layout.FlowPane;
7 import javafx.stage.Stage;
8
9 public class ShowFlowPane extends Application {
10 @Override
11 public void start(Stage primaryStage) {
12
13 FlowPane pane = new FlowPane();
14 pane.setPadding(new Insets(11, 12, 13, 14));
15 pane.setHgap(5);
16 pane.setVgap(5);
17
18
19 pane.getChildren().addAll(new Label("First Name:"),
20 new TextField(), new Label("MI:"));
21 TextField tfMi = new TextField();
22 tfMi.setPrefColumnCount(1);
23 pane.getChildren().addAll(tfMi, new Label("Last Name:"),
24 new TextField());
25
26
27 Scene scene = new Scene(pane, 200, 250);
28 primaryStage.setTitle("ShowFlowPane");
29 primaryStage.setScene(scene);
30 primaryStage.show();
31 }
32
33
37 public static void main(String[] args) {
38 launch(args);
39 }
40 }