List of usage examples for javafx.scene Group getChildren
@Override
public ObservableList<Node> getChildren()
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); primaryStage.setScene(scene);/*ww w . j a v a 2 s. c o m*/ primaryStage.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(); 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); primaryStage.setScene(scene);//from www . j a va2 s . c om 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(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); primaryStage.setScene(scene);/*from w ww. j a v a 2 s. co m*/ primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Colors"); Group root = new Group(); Scene scene = new Scene(root, 350, 300, Color.WHITE); Ellipse ellipse = new Ellipse(100, 50 + 70 / 2, 50, 70 / 2); RadialGradient gradient1 = RadialGradientBuilder.create().focusAngle(0).focusDistance(.1).centerX(80) .centerY(45).radius(120).proportional(false).cycleMethod(CycleMethod.NO_CYCLE) .stops(new Stop(0, Color.RED), new Stop(1, Color.BLACK)).build(); ellipse.setFill(gradient1);/* w w w. j a va 2 s . c om*/ root.getChildren().add(ellipse); primaryStage.setScene(scene); primaryStage.show(); }
From source file:eu.mihosoft.fx.tutorials.gravity.SolarSystem.java
/** * Returns this solar system as JavaFX node. * * @return/*from www. j a v a 2 s. c o m*/ */ public Group toJavaFX() { Group root = new Group(); if (nodes == null) { return root; } root.getChildren().addAll(nodes); return root; }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Menus"); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); MenuBar menuBar = new MenuBar(); Menu tools = new Menu("Your Menu"); tools.getItems().add(CheckMenuItemBuilder.create().text("Item 1").selected(true).build()); tools.getItems().add(CheckMenuItemBuilder.create().text("Item 2").selected(true).build()); menuBar.getMenus().add(tools);/*from w w w . ja v a2 s. c o m*/ menuBar.prefWidthProperty().bind(primaryStage.widthProperty()); root.getChildren().add(menuBar); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Menus"); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); MenuBar menuBar = new MenuBar(); Menu tools = new Menu("Your Menu"); CheckMenuItem item = new CheckMenuItem("Item 1"); tools.getItems().add(item);//w ww . ja va2 s. c om tools.getItems().add(CheckMenuItemBuilder.create().text("Item 2").selected(true).build()); menuBar.getMenus().add(tools); menuBar.prefWidthProperty().bind(primaryStage.widthProperty()); root.getChildren().add(menuBar); primaryStage.setScene(scene); primaryStage.show(); }
From source file:net.gazeplay.commons.utils.License.java
public License(double X, double Y, double width, double height, GazePlay gazePlay, Scene scene, Group root) { super(X, Y, width, height); this.setFill(new ImagePattern(new Image("data/common/images/license.png"), 0, 0, 1, 1, true)); EventHandler<Event> homeEvent = new EventHandler<javafx.event.Event>() { @Override/*from w w w. j ava2 s .c o m*/ public void handle(javafx.event.Event e) { if (e.getEventType() == MouseEvent.MOUSE_CLICKED) { root.getChildren().add(licence(width, height)); gazePlay.getHomeMenuScreen(); } } }; this.addEventHandler(MouseEvent.MOUSE_CLICKED, homeEvent); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Menus"); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); MenuBar menuBar = new MenuBar(); Menu menu = new Menu("File"); menu.getItems().add(new MenuItem("New")); menu.getItems().add(new MenuItem("Save")); menu.getItems().add(new SeparatorMenuItem()); menu.getItems().add(new MenuItem("Exit")); menuBar.getMenus().add(menu);//ww w . java2s. co m menuBar.prefWidthProperty().bind(primaryStage.widthProperty()); root.getChildren().add(menuBar); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(final Stage stage) throws Exception { Group rootGroup = new Group(); Scene scene = new Scene(rootGroup, 800, 400); Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.CHOCOLATE); text1.setFont(Font.font(java.awt.Font.MONOSPACED, 35)); final Light.Distant light = new Light.Distant(); light.setAzimuth(-135.0);/* w ww . ja v a 2 s .c om*/ final Lighting lighting = new Lighting(); lighting.setLight(light); lighting.setSurfaceScale(9.0); text1.setEffect(lighting); rootGroup.getChildren().add(text1); stage.setScene(scene); stage.show(); }