Source Code : Add Reflection to Text
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Add Reflection to Text
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.effect.Reflection;
import javafx.scene.paint.Color;
import javafx.scene.text.Font;
import javafx.scene.text.Text;
import javafx.stage.Stage;
public class Main extends Application {
public static void main(String[] args) {
Application.launch(args);
}
@Override
public void start(Stage primaryStage) {
primaryStage.setTitle("Text Fonts");
Group root = new Group();
Scene scene = new Scene(root, 550, 250, Color.WHITE);
Text text = new Text(50, 50, "JavaFX 2.0 from Java2s.com");
Font monoFont = Font.font("Dialog", 30);
text.setFont(monoFont);
text.setFill(Color.BLACK);
root.getChildren().add(text);
Reflection refl = new Reflection();
refl.setFraction(0.8f);
text.setEffect(refl);
primaryStage.setScene(scene);
primaryStage.show();
}
}
Thank with us