List of usage examples for javafx.scene.text Text setFont
public final void setFont(Font value)
From source file:Main.java
@Override public void start(final Stage stage) throws Exception { Group rootGroup = new Group(); Scene scene = new Scene(rootGroup, 800, 400); Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.CHOCOLATE); text1.setFont(Font.font(java.awt.Font.MONOSPACED, 35)); final Reflection reflection = new Reflection(); reflection.setFraction(1.0);// ww w . ja v a2 s. c o m text1.setEffect(reflection); rootGroup.getChildren().add(text1); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, 40, 30); final Group root = new Group(circ); final Scene scene = new Scene(root, 800, 400, Color.BEIGE); final Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.DARKBLUE); text1.setFont(Font.font(java.awt.Font.SERIF, 25)); root.getChildren().add(text1);/*from www . j av a 2 s. c o m*/ primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, 40, 30); final Group root = new Group(circ); final Scene scene = new Scene(root, 800, 400, Color.BEIGE); final Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.CHOCOLATE); text1.setFont(Font.font(java.awt.Font.SERIF, 25)); root.getChildren().add(text1);//from w w w .j a va 2 s .c o m primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(final Stage stage) throws Exception { Group rootGroup = new Group(); Scene scene = new Scene(rootGroup, 800, 400); Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.CHOCOLATE); text1.setFont(Font.font(java.awt.Font.MONOSPACED, 35)); final Light.Distant light = new Light.Distant(); light.setAzimuth(-135.0);/*from www. jav a2 s . c o m*/ final Lighting lighting = new Lighting(); lighting.setLight(light); lighting.setSurfaceScale(9.0); text1.setEffect(lighting); rootGroup.getChildren().add(text1); stage.setScene(scene); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, 40, 30); final Group root = new Group(circ); final Scene scene = new Scene(root, 800, 400, Color.BEIGE); final Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.DARKBLUE); text1.setFont(Font.font(java.awt.Font.SERIF, 25)); final Effect glow = new Glow(1.0); text1.setEffect(glow);//from ww w . j av a2 s .c om root.getChildren().add(text1); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Text msg = new Text("java2s.com"); msg.setTextOrigin(VPos.TOP);/*from ww w.j a v a 2 s .co m*/ msg.setFont(Font.font(24)); Pane root = new Pane(msg); root.setPrefSize(500, 70); Scene scene = new Scene(root); stage.setScene(scene); stage.setTitle("Scrolling Text"); stage.show(); double sceneWidth = scene.getWidth(); double msgWidth = msg.getLayoutBounds().getWidth(); KeyValue initKeyValue = new KeyValue(msg.translateXProperty(), sceneWidth); KeyFrame initFrame = new KeyFrame(Duration.ZERO, initKeyValue); KeyValue endKeyValue = new KeyValue(msg.translateXProperty(), -1.0 * msgWidth); KeyFrame endFrame = new KeyFrame(Duration.seconds(3), endKeyValue); Timeline timeline = new Timeline(initFrame, endFrame); timeline.setCycleCount(Timeline.INDEFINITE); timeline.play(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Title"); final Circle circ = new Circle(40, 40, 30); final Group root = new Group(circ); final Scene scene = new Scene(root, 800, 400, Color.BEIGE); final Text text1 = new Text(25, 25, "java2s.com"); text1.setFill(Color.DARKBLUE); text1.setFont(Font.font(java.awt.Font.SERIF, 25)); final Reflection reflection = new Reflection(); reflection.setFraction(1.0);//from ww w . j a v a 2s. c o m text1.setEffect(reflection); root.getChildren().add(text1); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group root = new Group(); Scene scene = new Scene(root, 550, 250, Color.hsb(270, 1.0, 1.0, 1.0)); Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com"); Font sanSerif = Font.font("Dialog", 30); text.setFont(sanSerif); text.setFill(Color.RED);//from ww w . j a va2 s.com root.getChildren().add(text); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group root = new Group(); Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF", 1.0)); Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com"); Font sanSerif = Font.font("Dialog", 30); text.setFont(sanSerif); text.setFill(Color.RED);// w w w.j av a2s . co m root.getChildren().add(text); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group root = new Group(); Scene scene = new Scene(root, 550, 250, Color.web("0x0000FF")); Text text = new Text(50, 100, "JavaFX 2.0 from Java2s.com"); Font sanSerif = Font.font("Dialog", 30); text.setFont(sanSerif); text.setFill(Color.RED);/*from www . j a va2s .co m*/ root.getChildren().add(text); primaryStage.setScene(scene); primaryStage.show(); }