Another simple but powerful effect is Reflection.
The API is straightforward:
// chapter8/basiceffects/ReflectionDemo.javapublic void start(Stage primaryStage) { Reflection reflection = new Reflection(); reflection.setTopOffset(5); // how far from source the reflection should start reflection.setFraction(0.7); // size of the reflection // starting and ending opacity levels reflection.setTopOpacity(0.05); reflection.setBottomOpacity(0.5); Button button = new Button("Button"); button.setEffect(reflection); primaryStage.setTitle("Reflection Demo"); primaryStage.setScene(new Scene(new StackPane(button), 300, 250)); primaryStage.show();}
The preceding code produces the following: