List of usage examples for javafx.scene Group Group
public Group()
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); final NumberAxis xAxis = new NumberAxis(1, 12, 1); final NumberAxis yAxis = new NumberAxis(); final StackedAreaChart<Number, Number> stackedAreaChart = new StackedAreaChart<Number, Number>(xAxis, yAxis);//from w w w .j av a2 s .c om final XYChart.Series<Number, Number> series1 = new XYChart.Series<Number, Number>(); xAxis.setLabel("Month"); yAxis.setLabel("Value"); stackedAreaChart.setTitle("StackedAreaChart"); series1.setName("XYChart.Series 1"); series1.getData().add(new XYChart.Data(1, 100)); series1.getData().add(new XYChart.Data(2, 200)); series1.getData().add(new XYChart.Data(10, 150)); XYChart.Series<Number, Number> series2 = new XYChart.Series(); series2.setName("XYChart.Series 2"); series2.getData().add(new XYChart.Data(1, 50)); series2.getData().add(new XYChart.Data(2, 200)); series2.getData().add(new XYChart.Data(10, 260)); stackedAreaChart.getData().addAll(series1, series2); root.getChildren().addAll(stackedAreaChart); primaryStage.setScene(new Scene(root, 500, 400)); primaryStage.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(); 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 . ja v a 2 s. com primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group()); stage.setTitle("Sample"); stage.setWidth(300);/*from w w w . ja va 2s. com*/ stage.setHeight(190); VBox vbox = new VBox(); vbox.setLayoutX(20); vbox.setLayoutY(20); Rectangle rect = new Rectangle(50, 50, Color.RED); rect.getTransforms().add(new Rotate(45, 0, 0)); // vbox.getChildren().add(rect); vbox.setSpacing(10); ((Group) scene.getRoot()).getChildren().add(vbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); TextField notification = new TextField(); notification.setText("Label"); notification.clear();// w ww . ja v a 2s . c o m GridPane grid = new GridPane(); grid.setVgap(4); grid.setHgap(10); grid.setPadding(new Insets(5, 5, 5, 5)); grid.add(new Label("To: "), 0, 0); grid.add(notification, 1, 0); Group root = (Group) scene.getRoot(); root.getChildren().add(grid); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); TilePane tile = new TilePane(); tile.setHgap(8);/* ww w . j a va 2 s .c om*/ tile.setPrefColumns(4); for (int i = 0; i < 20; i++) { tile.getChildren().add(new CheckBox("CheckBox")); } HBox hbox = new HBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); hbox.getChildren().setAll(tile); System.out.println(TilePane.getMargin(hbox)); Group root = (Group) scene.getRoot(); root.getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); ComboBox<String> emailComboBox = new ComboBox<String>(); emailComboBox.getItems().addAll("A", "B", "C", "D", "E"); emailComboBox.setValue("A"); System.out.println(emailComboBox.getValue()); GridPane grid = new GridPane(); grid.setVgap(4);/*from w w w .j a v a2 s.c o m*/ grid.setHgap(10); grid.setPadding(new Insets(5, 5, 5, 5)); grid.add(new Label("To: "), 0, 0); grid.add(emailComboBox, 1, 0); Group root = (Group) scene.getRoot(); root.getChildren().add(grid); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); TilePane tile = new TilePane(); tile.setHgap(8);//from w w w.j a va 2s. c o m tile.setPrefColumns(4); for (int i = 0; i < 20; i++) { tile.getChildren().add(new CheckBox("CheckBox")); } HBox hbox = new HBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); hbox.getChildren().setAll(tile); System.out.println(TilePane.getAlignment(hbox)); Group root = (Group) scene.getRoot(); root.getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); TilePane tile = new TilePane(); tile.setHgap(8);//from w ww. j av a 2s . com tile.setPrefColumns(4); for (int i = 0; i < 20; i++) { tile.getChildren().add(new CheckBox("CheckBox")); } HBox hbox = new HBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); hbox.getChildren().setAll(tile); TilePane.clearConstraints(hbox); Group root = (Group) scene.getRoot(); root.getChildren().add(hbox); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(final Stage stage) { stage.setWidth(500);/*ww w .j av a 2s . c om*/ stage.setHeight(500); Scene scene = new Scene(new Group()); VBox root = new VBox(); CategoryAxis lineXAxis = new CategoryAxis(getData()); root.getChildren().addAll(lineXAxis); scene.setRoot(root); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new Group(), 450, 250); TilePane tile = new TilePane(); tile.setHgap(8);// ww w. j ava2 s . c o m tile.setPrefColumns(4); for (int i = 0; i < 20; i++) { tile.getChildren().add(new CheckBox("CheckBox")); } HBox hbox = new HBox(10); hbox.setPadding(new Insets(20, 0, 0, 20)); hbox.getChildren().setAll(tile); System.out.println(tile.alignmentProperty()); Group root = (Group) scene.getRoot(); root.getChildren().add(hbox); stage.setScene(scene); stage.show(); }