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) { primaryStage.setTitle("Text Fonts"); Group g = new Group(); Scene scene = new Scene(g, 550, 250, Color.web("0x0000FF", 1.0)); Arc arc = new Arc(); arc.setCenterX(50.0f);//from ww w. j av a 2 s .co m arc.setCenterY(50.0f); arc.setRadiusX(25.0f); arc.setRadiusY(25.0f); arc.setStartAngle(45.0f); arc.setLength(270.0f); arc.setType(ArcType.ROUND); g.getChildren().add(arc); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle(""); Group g = new Group(); Scene scene = new Scene(g, 550, 250); TitledPane t1 = new TitledPane("T1", new Button("B1")); TitledPane t2 = new TitledPane("T2", new Button("B2")); TitledPane t3 = new TitledPane("T3", new Button("B3")); Accordion accordion = new Accordion(); accordion.getPanes().addAll(t1, t2, t3); g.getChildren().add(accordion); primaryStage.setScene(scene);/*from 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("java-buddy.blogspot.com"); tableView.setEditable(true);//w w w . j a v a2 s . c o m Callback<TableColumn, TableCell> cellFactory = new Callback<TableColumn, TableCell>() { @Override public TableCell call(TableColumn p) { return new EditingCell(); } }; btnNew.setOnAction(btnNewHandler); //init table //Un-editable column of "id" TableColumn col_id = new TableColumn("ID"); tableView.getColumns().add(col_id); col_id.setCellValueFactory(new PropertyValueFactory<Record, String>("id")); //Editable columns for (int i = 0; i < Day.length; i++) { TableColumn col = new TableColumn(Day[i]); col.setCellValueFactory(new PropertyValueFactory<Record, String>("value_" + String.valueOf(i))); tableView.getColumns().add(col); col.setCellFactory(cellFactory); } tableView.setItems(data); Group root = new Group(); VBox vBox = new VBox(); vBox.setSpacing(10); vBox.getChildren().addAll(btnNew, tableView); root.getChildren().add(vBox); primaryStage.setScene(new Scene(root, 500, 400)); 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);//from w ww . ja v a2s . c o m stage.setTitle(""); QuadCurve quad = new QuadCurve(); quad.setStartX(0.0f); quad.setStartY(50.0f); quad.setEndX(50.0f); quad.setEndY(50.0f); quad.setControlX(25.0f); quad.setControlY(0.0f); root.getChildren().add(quad); scene.setRoot(root); stage.show(); }
From source file:at.ac.tuwien.qse.sepm.gui.control.ImageTile.java
public ImageTile() { getStyleClass().add("imageTile"); Group overlay = new Group(); HBox overlayBox = new HBox(); overlayBox.getStyleClass().add("hoverlay"); overlayBox.getChildren().addAll(overLayIcon, name); overlay.getChildren().add(overlayBox); StackPane.setAlignment(overlay, Pos.CENTER); placeHolder.setGlyphSize(ImageSize.LARGE.pixels() * 0.6); setMinHeight(0);// ww w . j a v a 2 s. c o m setMinWidth(0); imageView.setPreserveRatio(false); getChildren().add(placeHolder); getChildren().add(imageView); getChildren().add(overlay); setAlignment(overlay, Pos.CENTER); setOnMouseEntered((event) -> { if (photos.size() > 0) { setCursor(Cursor.HAND); } }); setOnMouseExited((event -> setCursor(Cursor.DEFAULT))); imageView.visibleProperty().bind(photosProperty.emptyProperty().not()); overlay.visibleProperty().bind(photosProperty.emptyProperty().not().and(name.textProperty().isNotEmpty())); placeHolder.visibleProperty().bind(photosProperty.emptyProperty()); heightProperty().addListener(this::handleSizeChange); widthProperty().addListener(this::handleSizeChange); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Hello World"); Group root = new Group(); Scene scene = new Scene(root, 300, 250); Button btn = new Button("Hello World"); btn.setLayoutX(100);/* ww w. ja v a 2 s .c o m*/ btn.setLayoutY(80); btn.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent event) { System.out.println("Hello World"); } }); root.getChildren().add(btn); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { Group root = new Group(); Scene scene = new Scene(root, 300, 130, Color.WHITE); GridPane gridpane = new GridPane(); gridpane.setPadding(new Insets(5)); gridpane.setHgap(10);/*w ww . j a v a 2 s . c o m*/ gridpane.setVgap(10); Label label = new Label("Label"); GridPane.setHalignment(label, HPos.CENTER); gridpane.add(label, 0, 0); root.getChildren().add(gridpane); primaryStage.setScene(scene); 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); Group g = new Group(); DropShadow ds = new DropShadow(); ds.setOffsetY(3.0);/*from www .jav a 2 s . c om*/ ds.setColor(Color.color(0.4, 0.4, 0.4)); Ellipse ellipse = new Ellipse(); ellipse.setCenterX(50.0f); ellipse.setCenterY(50.0f); ellipse.setRadiusX(50.0f); ellipse.setRadiusY(25.0f); ellipse.setEffect(ds); g.getChildren().add(ellipse); root.getChildren().add(g); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); Group root = new Group(); Scene scene = new Scene(root, 600, 330, Color.WHITE); GridPane gridpane = new GridPane(); gridpane.setPadding(new Insets(5)); gridpane.setHgap(10);/*w w w . j a v a2 s . c o m*/ gridpane.setVgap(10); Label label = new Label("Label"); GridPane.setHalignment(label, HPos.CENTER); gridpane.add(label, 0, 0); root.getChildren().add(gridpane); 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 Reflection reflection = new Reflection(); reflection.setFraction(1.0);//from www.j a v a 2s . c om text1.setEffect(reflection); rootGroup.getChildren().add(text1); stage.setScene(scene); stage.show(); }