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(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group root = new Group(); Scene scene = new Scene(root, 550, 250, new Color(0, 0, 1, 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);/* www .j a v a2s .c o m*/ root.getChildren().add(text); primaryStage.setScene(scene); primaryStage.show(); }
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);/*www. jav a 2 s. c o m*/ Light.Distant light = new Light.Distant(); light.setAzimuth(-135.0); Lighting l = new Lighting(); l.setLight(light); l.setSurfaceScale(5.0); Text t = new Text(); t.setText("JavaFX!"); t.setFill(Color.RED); t.setFont(Font.font(null, FontWeight.BOLD, 90)); t.setX(10.0); t.setY(10.0); t.setTextOrigin(VPos.TOP); t.setEffect(l); box.getChildren().add(t); 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 Light.Distant light = new Light.Distant(); light.setAzimuth(-135.0);/*from w ww.j av a 2s . c o m*/ final Lighting lighting = new Lighting(); lighting.setLight(light); lighting.setSurfaceScale(9.0); text1.setEffect(lighting); root.getChildren().add(text1); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 600, 400); stage.setScene(scene);/* w ww . ja v a2s .c om*/ stage.setTitle("Slider Sample"); Text text = new Text("Using Shear for pseudo-italic font"); text.setX(20); text.setY(50); text.setFont(new Font(20)); text.getTransforms().add(new Shear(-0.35, 0)); root.getChildren().add(text); stage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group g = new Group(); Scene scene = new Scene(g, 550, 250); Rectangle r = new Rectangle(); r.setX(10);// ww w .j a v a 2s.c o m r.setY(10); r.setWidth(160); r.setHeight(80); r.setFill(Color.DARKBLUE); Text t = new Text(); t.setText("Bloom!"); t.setFill(Color.YELLOW); t.setFont(Font.font(null, FontWeight.BOLD, 36)); t.setX(25); t.setY(65); g.setCache(true); g.setEffect(new Bloom()); g.getChildren().add(r); g.getChildren().add(t); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage primaryStage) { primaryStage.setTitle("Text Fonts"); Group g = new Group(); Scene scene = new Scene(g, 550, 250, Color.web("0x0000FF", 1.0)); Rectangle r = new Rectangle(); r.setX(10);/* w w w.j a v a 2s . c om*/ r.setY(10); r.setWidth(160); r.setHeight(80); r.setFill(Color.DARKBLUE); Text t = new Text(); t.setText("Bloom!"); t.setFill(Color.YELLOW); t.setFont(Font.font(null, FontWeight.BOLD, 36)); t.setX(25); t.setY(65); g.setCache(true); g.setEffect(new Bloom()); g.getChildren().add(r); g.getChildren().add(t); 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.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);/*w w w . j a v a 2 s. c o m*/ root.getChildren().add(text); Reflection refl = new Reflection(); refl.setFraction(0.8f); text.setEffect(refl); 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); 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);// ww w . j a va2 s .c o m root.getChildren().add(text); BoxBlur bb = new BoxBlur(); bb.setWidth(15); bb.setHeight(15); bb.setIterations(3); text.setEffect(bb); 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. jav a2 s . c om*/ root.getChildren().add(text); BoxBlur bb = new BoxBlur(); bb.setWidth(15); bb.setHeight(15); bb.setIterations(3); text.setEffect(bb); primaryStage.setScene(scene); primaryStage.show(); }
From source file:Main.java
@Override public void start(Stage stage) { Group root = new Group(); Scene scene = new Scene(root, 300, 150); stage.setScene(scene);/*from w w w . j av a2s . co m*/ stage.setTitle("Sample"); Text t = new Text(10, 50, "This is a test"); t.setTextAlignment(TextAlignment.JUSTIFY); t.setText("First row"); t.setFont(new Font(20)); root.getChildren().add(t); stage.show(); }