List of usage examples for javafx.scene.layout HBox HBox
public HBox(Node... children)
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.LIGHTGRAY); HBox box = new HBox(arc); Scene scene = new Scene(box); stage.setScene(scene);//from www .ja va2 s . c o m stage.setTitle("Test"); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 300, 250); // 5 pixels space between child nodes HBox hbox = new HBox(5); // 1 pixel padding between child nodes only hbox.setPadding(new Insets(1)); Rectangle r1 = new Rectangle(10, 10); Rectangle r2 = new Rectangle(20, 100); Rectangle r3 = new Rectangle(50, 20); Rectangle r4 = new Rectangle(20, 50); HBox.setMargin(r1, new Insets(2, 2, 2, 2)); hbox.getChildren().addAll(r1, r2, r3, r4); root.getChildren().add(hbox);//from ww w . ja v a 2 s . com primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.TRANSPARENT); arc.setStroke(Color.BLACK);/*ww w . j a v a2 s . c o m*/ HBox box = new HBox(arc); Scene scene = new Scene(box); stage.setScene(scene); stage.setTitle("Test"); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); HBox hbox = new HBox(0.5); Button button1 = new Button("Add "); Button button2 = new Button("Remove "); HBox.setHgrow(button1, Priority.ALWAYS); HBox.setHgrow(button2, Priority.ALWAYS); button1.setMaxWidth(Double.MAX_VALUE); button2.setMaxWidth(Double.MAX_VALUE); hbox.getChildren().addAll(button1, button2); root.getChildren().add(hbox);/*from w w w . j a va2 s. c o m*/ primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.GRAY);// ww w . j av a 2s .c o m arc.setStroke(Color.BLACK); arc.setType(ArcType.ROUND); HBox box = new HBox(arc); Scene scene = new Scene(box); stage.setScene(scene); stage.setTitle("Test"); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.TRANSPARENT); arc.setStroke(Color.BLACK);//from w w w . j av a 2 s .c o m arc.setType(ArcType.ROUND); HBox box = new HBox(arc); Scene scene = new Scene(box); stage.setScene(scene); stage.setTitle("Test"); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.TRANSPARENT); arc.setStroke(Color.BLACK);/*w w w . j a v a2s .c om*/ arc.setType(ArcType.CHORD); HBox box = new HBox(arc); Scene scene = new Scene(box); stage.setScene(scene); stage.setTitle("Test"); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Arc arc = new Arc(0, 0, 50, 100, 0, 90); arc.setFill(Color.GRAY);//from w w w .ja v a 2s . com arc.setStroke(Color.BLACK); arc.setType(ArcType.ROUND); HBox box = new HBox(arc); box.setSpacing(10); box.setStyle("-fx-padding: 10;" + "-fx-border-style: solid inside;" + "-fx-border-width: 2;" + "-fx-border-insets: 5;" + "-fx-border-radius: 5;" + "-fx-border-color: blue;"); Scene scene = new Scene(box); stage.setScene(scene); stage.setTitle("Test"); stage.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 . ja v a2s . c o m stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle(""); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); HBox hbox = new HBox(8);//space Button button1 = new Button("Add "); Button button2 = new Button("Remove "); HBox.setHgrow(button1, Priority.ALWAYS); HBox.setHgrow(button2, Priority.ALWAYS); button1.setMaxWidth(Double.MAX_VALUE); button2.setMaxWidth(Double.MAX_VALUE); hbox.getChildren().addAll(button1, button2); hbox.setPrefWidth(400);/* w w w . j a va 2 s .c om*/ root.getChildren().add(hbox); primaryStage.setScene(scene); primaryStage.show(); }