List of usage examples for javafx.stage Stage setTitle
public final void setTitle(String value)
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("FlowPane example"); FlowPane flowPane = new FlowPane(); flowPane.setPadding(new Insets(10, 10, 10, 10)); flowPane.setVgap(4);/*ww w. ja va 2s.co m*/ flowPane.setHgap(4); flowPane.setPrefWrapLength(210); Button btn = new Button(); for (int i = 0; i < 8; i++) { btn = new Button("Button"); btn.setPrefSize(100, 50); flowPane.getChildren().add(btn); } Scene scene = new Scene(flowPane); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(final Stage stage) { stage.setTitle("HTML"); stage.setWidth(500);//from w w w .j a v a 2 s.com stage.setHeight(500); Scene scene = new Scene(new Group()); VBox root = new VBox(); Path path = new Path(); path.getElements().add(new MoveTo(50.0f, 0.0f)); VLineTo vlt = new VLineTo(50.0f); vlt.setY(.7); path.getElements().add(vlt); System.out.println(vlt.yProperty()); root.getChildren().addAll(path); scene.setRoot(root); stage.setScene(scene); stage.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); Text t = new Text(); t.setX(10.0);//from w w w. ja v a 2 s . c o m t.setY(50.0); t.setCache(true); t.setText("Reflections on JavaFX..."); t.setFill(Color.RED); t.setFont(Font.font(null, FontWeight.BOLD, 30)); Reflection r = new Reflection(); r.setFraction(0.7); t.setEffect(r); root.getChildren().add(t); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { stage.setTitle("Rotations"); stage.setScene(makeScene());//w ww. j av a 2 s. co m stage.show(); TimelineBuilder.create().cycleCount(Timeline.INDEFINITE).keyFrames( new KeyFrame(Duration.seconds(0), new KeyValue(translateZForNode1, -100), new KeyValue(angle, 0)), new KeyFrame(Duration.seconds(2), new KeyValue(translateZForNode1, 100), new KeyValue(angle, 180)), new KeyFrame(Duration.seconds(4), new KeyValue(translateZForNode1, -100), new KeyValue(angle, 360)) ).build().play(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("BorderPane Test"); BorderPane bp = new BorderPane(); bp.setPadding(new Insets(10, 20, 10, 20)); Button btnTop = new Button("Top"); bp.setTop(btnTop);// w w w. j a v a2s. c o m Button btnLeft = new Button("Left"); bp.setLeft(btnLeft); Button btnCenter = new Button("Center"); bp.setCenter(btnCenter); Button btnRight = new Button("Right"); bp.setRight(btnRight); Button btnBottom = new Button("Bottom"); bp.setBottom(btnBottom); Scene scene = new Scene(bp, 300, 200); primaryStage.setScene(scene); primaryStage.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 = EllipseBuilder.create().centerX(100).centerY(100).radiusX(50).radiusY(75 / 2) .strokeWidth(3).stroke(Color.BLACK).fill(Color.WHITE).build(); Ellipse smallCircle = EllipseBuilder.create().centerX(100).centerY(100).radiusX(35 / 2).radiusY(25 / 2) .build();/*from w w w.j ava 2 s . com*/ Shape shape = Path.subtract(bigCircle, smallCircle); shape.setStrokeWidth(1); shape.setStroke(Color.BLACK); shape.setFill(Color.rgb(255, 200, 0)); root.getChildren().add(shape); 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);//w ww . j a va 2 s . c o m 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(""); Group root = new Group(); Scene scene = new Scene(root, 300, 250, Color.WHITE); Group g = new Group(); Text t = new Text(); t.setX(10.0);/* w w w.j a va 2 s . co m*/ t.setY(40.0); t.setCache(true); t.setText("Blurry Text"); t.setFill(Color.RED); t.setFont(Font.font(null, FontWeight.BOLD, 36)); t.setEffect(new GaussianBlur()); g.getChildren().add(t); root.getChildren().add(g); 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); TextField field = new TextField() { @Override/* ww w .jav a 2s. c o m*/ public void replaceText(int start, int end, String text) { if (!text.matches("[a-z]")) { super.replaceText(start, end, text); } } @Override public void replaceSelection(String text) { if (!text.matches("[a-z]")) { super.replaceSelection(text); } } }; root.getChildren().add(field); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { stage.setTitle("HTML"); stage.setWidth(500);//from w w w . j a va 2s . c o m stage.setHeight(500); Scene scene = new Scene(new Group()); VBox root = new VBox(); InnerShadow is = new InnerShadow(); is.setOffsetX(4.0); is.setOffsetY(4.0); Text t = new Text(); t.setEffect(is); t.setX(20); t.setY(100); t.setText("java2s.com"); t.setFill(Color.YELLOW); t.setFont(Font.font(null, FontWeight.BOLD, 80)); root.getChildren().addAll(t); scene.setRoot(root); stage.setScene(scene); stage.show(); }