List of usage examples for javafx.stage Stage setScene
@Override final public void setScene(Scene value)
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); Rectangle rect = new Rectangle(100, 100); rect.setLayoutX(50);/*from ww w .j a va 2s. c o m*/ rect.setLayoutY(50); rect.setStrokeLineCap(StrokeLineCap.BUTT); ((Group) scene.getRoot()).getChildren().add(rect); stage.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); stage.setTitle("Sample"); Text t = new Text(10, 50, "This is a test"); t.setText("First row\nSecond row"); t.setFont(new Font(20)); root.getChildren().add(t);/* w ww .j a v a2 s. c o m*/ stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene); Group g = new Group(); ProgressBar p2 = new ProgressBar(); p2.setProgress(0.25F);//from ww w .j av a 2 s . c o m g.getChildren().add(p2); scene.setRoot(g); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene); Group g = new Group(); Polygon polygon = new Polygon(); polygon.getPoints().addAll(new Double[] { 0.0, 0.0, 20.0, 10.0, 10.0, 20.0 }); g.getChildren().add(polygon);/*from w ww. java 2 s.c o m*/ scene.setRoot(g); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene); Group g = new Group(); Polyline polyline = new Polyline(); polyline.getPoints().addAll(new Double[] { 0.0, 0.0, 20.0, 10.0, 10.0, 20.0 }); g.getChildren().add(polyline);//from ww w .j ava 2s . com scene.setRoot(g); 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); Rectangle rect = new Rectangle(200, 200, Color.RED); ScrollPane s1 = new ScrollPane(); s1.setPannable(true);// w ww . j a v a 2s . c o m s1.setPrefSize(120, 120); s1.setContent(rect); root.getChildren().add(s1); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene); Group g = new Group(); ProgressIndicator p1 = new ProgressIndicator(); p1.setProgress(0.25F);/*from w w w.j av a 2 s. co m*/ g.getChildren().add(p1); scene.setRoot(g); stage.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); stage.setTitle("Sample"); Text t = new Text(10, 50, "This is a test"); t.setWrappingWidth(200);/*from ww w. ja v a2 s .c o m*/ t.setText("First row Second row Second row Second row Second row Second row "); t.setFont(new Font(20)); root.getChildren().add(t); stage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 260, 80); stage.setScene(scene); Group g = new Group(); Polygon polygon = new Polygon(0.0, 0.0, 20.0, 10.0, 10.0, 20.0); g.getChildren().add(polygon);//from w ww. j av a2 s .com System.out.println(polygon.getPoints()); scene.setRoot(g); 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); 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 www. j av a 2 s. co m*/ }