List of usage examples for javafx.stage Stage show
@Override public final void show()
From source file:Main.java
License:asdf
@Override public void start(Stage stage) { stage.setTitle("HTML"); stage.setWidth(500);// ww w . j a va 2 s . com stage.setHeight(500); Scene scene = new Scene(new Group()); FlowPane flow = new FlowPane(Orientation.VERTICAL); flow.setVgap(8); flow.setHgap(4); flow.setPrefWrapLength(300); // preferred width = 300 for (int i = 0; i < 10; i++) { flow.getChildren().add(new Button("asdf")); } scene.setRoot(flow); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 500, 200); stage.setScene(scene);/*from ww w . j a v a 2s.c o m*/ Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds(); //set Stage boundaries to visible bounds of the main screen stage.setX(primaryScreenBounds.getMinX()); stage.setY(primaryScreenBounds.getMinY()); stage.setWidth(primaryScreenBounds.getWidth()); stage.setHeight(primaryScreenBounds.getHeight()); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Shapes"); Group root = new Group(); Scene scene = new Scene(root, 300, 300, Color.WHITE); Ellipse bigCircle = new Ellipse(); bigCircle.setCenterX(20);/*from w w w. ja va 2 s.c o m*/ bigCircle.setCenterY(20); bigCircle.setRadiusX(10); bigCircle.setRadiusY(10); System.out.println(bigCircle.centerXProperty().doubleValue()); root.getChildren().add(bigCircle); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Scene scene = new Scene(new HBox(20), 400, 100); HBox box = (HBox) scene.getRoot();//from w w w . j a v a 2 s . c o m final ColorPicker colorPicker = new ColorPicker(); colorPicker.setValue(Color.RED); final Text text = new Text("Color picker:"); text.setFill(colorPicker.getValue()); colorPicker.setOnAction((ActionEvent t) -> { text.setFill(colorPicker.getValue()); }); box.getChildren().addAll(colorPicker, text); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { createControls();/*from ww w .j a va 2 s . c o m*/ createMedia(); final Scene scene = new Scene(createGridPane(), 800, 400); // final URL stylesheet = getClass().getResource("media.css"); // scene.getStylesheets().add(stylesheet.toString()); primaryStage.setScene(scene); primaryStage.setTitle("Audio Player 2"); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Button b1 = new Button("Close"); b1.setEffect(new DropShadow()); Button b2 = new Button("Close"); Button b3 = new Button("Close"); b3.setEffect(new DropShadow()); b3.setRotate(30);//from w ww. jav a 2 s . com Button b4 = new Button("Close"); VBox root = new VBox(); root.getChildren().addAll(b1, b2, b3, b4); Scene scene = new Scene(root); stage.setScene(scene); stage.setTitle("Testing LayoutBounds"); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 500, 200); stage.setScene(scene);// ww w . j a va2s .c om Rectangle rect = new Rectangle(100, 40, 100, 100); rect.setArcHeight(50); rect.setArcWidth(50); rect.setFill(Color.VIOLET); RotateTransition rt = new RotateTransition(Duration.millis(3000), rect); rt.setByAngle(180); rt.setAutoReverse(true); rt.play(); root.getChildren().add(rect); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { msgLbl.setPrefWidth(150);//from ww w . j ava2 s. com sayHelloBtn.setOnAction(this::sayHello); VBox root = new VBox(10); root.getChildren().addAll(msgLbl, sayHelloBtn); root.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(root); stage.setScene(scene); stage.setTitle("Hello FXML"); stage.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 ww w . j a va 2s. c o m text1.setEffect(reflection); rootGroup.getChildren().add(text1); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Shapes"); Group root = new Group(); Scene scene = new Scene(root, 300, 300, Color.WHITE); Ellipse bigCircle = new Ellipse(20, 20); bigCircle.setCenterX(20);//from w w w . ja v a2 s .c om bigCircle.setCenterY(20); bigCircle.setRadiusX(10); bigCircle.setRadiusY(10); System.out.println(bigCircle.centerXProperty().doubleValue()); root.getChildren().add(bigCircle); primaryStage.setScene(scene); primaryStage.show(); }