List of usage examples for javafx.geometry Insets Insets
public Insets(@NamedArg("top") double top, @NamedArg("right") double right, @NamedArg("bottom") double bottom, @NamedArg("left") double left)
From source file:Main.java
@Override public void start(Stage primaryStage) { BorderPane bp = new BorderPane(); bp.setPadding(new Insets(10, 50, 50, 50)); Scene scene = new Scene(bp); primaryStage.setScene(scene);/*from w ww. ja v a2 s . c om*/ primaryStage.titleProperty() .bind(scene.widthProperty().asString().concat(" : ").concat(scene.heightProperty().asString())); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { BorderPane bp = new BorderPane(); bp.setPadding(new Insets(10, 20, 10, 20)); Button btnTop = new Button("Top"); bp.setTop(btnTop);/*ww w .j av a2s . c o m*/ Button btnLeft = new Button("Left"); bp.setLeft(btnLeft); Button btnCenter = new Button("Center"); bp.setCenter(btnCenter); Button btnRight = new Button("Right"); bp.setRight(btnRight); Button btnBottom = new Button("Bottom"); bp.setBottom(btnBottom); Scene scene = new Scene(bp, 300, 200); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { BorderPane bp = new BorderPane(); bp.setPadding(new Insets(10, 20, 10, 20)); Button btnTop = new Button("Top"); bp.setTop(btnTop);// w w w .ja v a 2 s .c o m Button btnLeft = new Button("Left"); bp.setLeft(btnLeft); Button btnCenter = new Button("Center"); bp.setCenter(btnCenter); Button btnRight = new Button("Right"); bp.setRight(btnRight); Button btnBottom = new Button("Bottom"); bp.setBottom(btnBottom); Scene scene = new Scene(bp, 300, 200); primaryStage.setScene(scene); primaryStage.show(); System.out.println(bp.getTop()); System.out.println(bp.getBottom()); System.out.println(bp.getLeft()); System.out.println(bp.getRight()); System.out.println(bp.getCenter()); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("FlowPane example"); FlowPane flowPane = new FlowPane(); flowPane.setPadding(new Insets(10, 10, 10, 10)); flowPane.setVgap(4);/*ww w . j a v a 2 s . c om*/ flowPane.setHgap(4); flowPane.setPrefWrapLength(210); Button btn = new Button(); for (int i = 0; i < 8; i++) { btn = new Button("Button"); btn.setPrefSize(100, 50); flowPane.getChildren().add(btn); } Scene scene = new Scene(flowPane); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("BorderPane Test"); BorderPane bp = new BorderPane(); bp.setPadding(new Insets(10, 20, 10, 20)); Button btnTop = new Button("Top"); bp.setTop(btnTop);/*from ww w . ja va 2s. co m*/ Button btnLeft = new Button("Left"); bp.setLeft(btnLeft); Button btnCenter = new Button("Center"); bp.setCenter(btnCenter); Button btnRight = new Button("Right"); bp.setRight(btnRight); Button btnBottom = new Button("Bottom"); bp.setBottom(btnBottom); Scene scene = new Scene(bp, 300, 200); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("HBox Test"); // HBox/*w ww. ja va2s. c om*/ HBox hb = new HBox(); hb.setPadding(new Insets(15, 12, 15, 12)); hb.setSpacing(10); // Buttons Button btn1 = new Button(); btn1.setText("Button1"); hb.getChildren().add(btn1); Button btn2 = new Button(); btn2.setText("Button2"); hb.getChildren().add(btn2); Button btn3 = new Button(); btn3.setText("Button3"); hb.getChildren().add(btn3); Button btn4 = new Button(); btn4.setText("Button4"); hb.getChildren().add(btn4); // Adding HBox to the scene Scene scene = new Scene(hb); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 300, 150); stage.setScene(scene);//w w w.j ava 2 s .c o m stage.setTitle("Text Field Sample"); GridPane grid = new GridPane(); grid.setPadding(new Insets(10, 10, 10, 10)); grid.setVgap(5); grid.setHgap(5); scene.setRoot(grid); final TextField name = new TextField(); name.setPromptText("Enter your first name."); name.setPrefColumnCount(10); name.getText(); GridPane.setConstraints(name, 0, 0); grid.getChildren().add(name); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("VBox Test"); VBox vb = new VBox(); vb.setPadding(new Insets(10, 50, 50, 50)); vb.setSpacing(10);/*from www . j a v a2 s . c o m*/ Label lbl = new Label("VBox"); lbl.setFont(Font.font("Amble CN", FontWeight.BOLD, 24)); vb.getChildren().add(lbl); Button btn1 = new Button(); btn1.setText("Button1"); vb.getChildren().add(btn1); Button btn2 = new Button(); btn2.setText("Button2"); vb.getChildren().add(btn2); Button btn3 = new Button(); btn3.setText("Button3"); vb.getChildren().add(btn3); Button btn4 = new Button(); btn4.setText("Button4"); vb.getChildren().add(btn4); // Adding VBox to the scene Scene scene = new Scene(vb); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 350, 250); TitledPane titledPane = new TitledPane("My Title", new CheckBox("OK")); HBox hbox = new HBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); hbox.getChildren().setAll(titledPane); Group root = (Group) scene.getRoot(); root.getChildren().add(hbox);/*from ww w .j ava 2 s . c om*/ stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("VBox Test"); // VBox//from www .ja v a 2 s .c o m VBox vb = new VBox(); vb.setPadding(new Insets(10, 50, 50, 50)); vb.setSpacing(10); Label lbl = new Label("VBox"); lbl.setFont(Font.font("Amble CN", FontWeight.BOLD, 24)); vb.getChildren().add(lbl); // Buttons Button btn1 = new Button(); btn1.setText("Button1"); vb.getChildren().add(btn1); Button btn2 = new Button(); btn2.setText("Button2"); vb.getChildren().add(btn2); Button btn3 = new Button(); btn3.setText("Button3"); vb.getChildren().add(btn3); Button btn4 = new Button(); btn4.setText("Button4"); vb.getChildren().add(btn4); // Adding VBox to the scene Scene scene = new Scene(vb); primaryStage.setScene(scene); primaryStage.show(); }