List of usage examples for javafx.scene.paint CycleMethod REFLECT
CycleMethod REFLECT
To view the source code for javafx.scene.paint CycleMethod REFLECT.
Click Source Link
From source file:Main.java
@Override public void start(Stage stage) { VBox box = new VBox(); final Scene scene = new Scene(box, 300, 250); scene.setFill(null);//from w w w . j a v a 2s . c om // A rectangle filled with a linear gradient with a translucent color. Rectangle rectangle = new Rectangle(); rectangle.setX(50); rectangle.setY(50); rectangle.setWidth(100); rectangle.setHeight(70); LinearGradient cycleGrad = new LinearGradient(50, // start X 50, // start Y 70, // end X 70, // end Y false, // proportional CycleMethod.REFLECT, // cycleMethod new Stop(0f, Color.rgb(21, 25, 0, .784)), new Stop(1.0f, Color.rgb(0, 210, 0, .784))); rectangle.setFill(cycleGrad); box.getChildren().add(rectangle); stage.setScene(scene); stage.show(); }