List of usage examples for javafx.scene.paint Color WHITE
Color WHITE
To view the source code for javafx.scene.paint Color WHITE.
Click Source Link
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); hbox.setPrefWidth(400);/*from www. j a va 2s .co m*/ System.out.println(hbox.getContentBias()); root.getChildren().add(hbox); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Borders"); 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);//from w ww. ja va 2 s .c o m gridpane.setVgap(10); final String cssDefault = "-fx-border-color: blue;\n" + "-fx-border-insets: 5;\n" + "-fx-border-width: 3;\n" + "-fx-border-style: dashed;\n"; final HBox pictureRegion = new HBox(); pictureRegion.setStyle(cssDefault); gridpane.add(pictureRegion, 1, 1, 10, 10); root.getChildren().add(gridpane); 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); Path path = new Path(); QuadCurve quad = QuadCurveBuilder.create().startX(50).startY(50).endX(150).endY(50).controlX(125) .controlY(150).translateY(path.getBoundsInParent().getMaxY()).strokeWidth(3).stroke(Color.BLACK) .fill(Color.WHITE).build(); root.getChildren().add(quad);//from w w w.java 2s . com 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"); 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 ww. ja v a 2 s . c om menuBar.prefWidthProperty().bind(primaryStage.widthProperty()); root.getChildren().add(menuBar); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { final Group group = new Group(); Scene scene = new Scene(group, 300, 150); stage.setScene(scene);// w w w .j a v a 2 s . co m stage.setTitle("Sample"); Stop[] stops = { new Stop(0, Color.WHITE), new Stop(1, Color.BLACK) }; LinearGradient lg = new LinearGradient(0, 0, 1, 0, true, CycleMethod.NO_CYCLE, stops); Rectangle r = new Rectangle(20, 20, 200, 200); r.setFill(lg); group.getChildren().add(r); 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 = 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 ww . j av a 2s . c o m*/ 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(final Stage primaryStage) { primaryStage.setTitle(""); Group root = new Group(); Scene scene = new Scene(root, 400, 300, Color.WHITE); GridPane gridpane = new GridPane(); ColumnConstraints col1 = new ColumnConstraints(); col1.setPercentWidth(25);//from www . j a va 2s . c o m ColumnConstraints col2 = new ColumnConstraints(); col2.setPercentWidth(50); ColumnConstraints col3 = new ColumnConstraints(); col3.setPercentWidth(25); gridpane.getColumnConstraints().addAll(col1, col2, col3); gridpane.add(new Label("2"), 2, 0); gridpane.add(new Label("1"), 1, 0); gridpane.add(new Label("0"), 0, 0); root.getChildren().add(gridpane); 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();/* w w w. j av a2 s . c o m*/ Shape shape = Path.subtract(bigCircle, smallCircle); shape.setStrokeWidth(1); shape.setStroke(Color.BLACK); shape.setFill(Color.rgb(255, 200, 0)); DropShadow dropShadow = DropShadowBuilder.create().offsetX(2.0f).offsetY(2.0f) .color(Color.rgb(50, 50, 50, .588)).build(); shape.setEffect(dropShadow); 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); Text t = new Text(); t.setX(10.0);/*from w w w. j a 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 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);/* www .ja va 2 s . c o 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(); }