Example usage for javafx.scene.text FontWeight BOLD

List of usage examples for javafx.scene.text FontWeight BOLD

Introduction

In this page you can find the example usage for javafx.scene.text FontWeight BOLD.

Prototype

FontWeight BOLD

To view the source code for javafx.scene.text FontWeight BOLD.

Click Source Link

Document

represents Bold font weight (700).

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("VBox Test");

    VBox vb = new VBox();
    vb.setPadding(new Insets(10, 50, 50, 50));
    vb.setSpacing(10);//from  w ww.  j  a  v a2s  .com
    vb.setAlignment(Pos.BASELINE_LEFT);
    System.out.println(vb.alignmentProperty());

    Label lbl = new Label("VBox");
    lbl.setFont(Font.font("Amble CN", FontWeight.BOLD, 24));
    vb.getChildren().add(lbl);

    Button btn1 = new Button();
    btn1.setText("Button1");
    vb.getChildren().add(btn1);

    Button btn2 = new Button();
    btn2.setText("Button2");
    vb.getChildren().add(btn2);

    Button btn3 = new Button();
    btn3.setText("Button3");
    vb.getChildren().add(btn3);

    Button btn4 = new Button();
    btn4.setText("Button4");
    vb.getChildren().add(btn4);

    // Adding VBox to the scene
    Scene scene = new Scene(vb);
    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);//from   ww w  .  j  a  va 2s  .c om

    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 stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);/*w  w w.ja v  a  2s. c o m*/
    stage.setHeight(500);
    Scene scene = new Scene(new Group());
    VBox root = new VBox();

    InnerShadow is = new InnerShadow();
    is.setOffsetX(4.0);
    is.setOffsetY(4.0);

    Text t = new Text();
    t.setEffect(is);
    t.setX(20);
    t.setY(100);
    t.setText("java2s.com");
    t.setFill(Color.YELLOW);
    t.setFont(Font.font(null, FontWeight.BOLD, 80));

    root.getChildren().addAll(t);

    scene.setRoot(root);

    stage.setScene(scene);
    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);//from  w  w w  .  j a va 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 g = new Group();
    Scene scene = new Scene(g, 550, 250, Color.web("0x0000FF", 1.0));

    Rectangle r = new Rectangle();
    r.setX(10);/*ww w . ja v a2s.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("");
    Group root = new Group();
    Scene scene = new Scene(root, 300, 250, Color.WHITE);

    Group g = new Group();

    DropShadow ds = new DropShadow();
    ds.setOffsetY(3.0);/*from   w w  w. j a va 2 s.  co m*/
    ds.setColor(Color.color(0.4, 0.4, 0.4));

    Text t = new Text();
    t.setEffect(ds);
    t.setCache(true);
    t.setX(10.0);
    t.setY(70.0);
    t.setFill(Color.RED);
    t.setText("JavaFX drop shadow...");
    t.setFont(Font.font(null, FontWeight.BOLD, 32));
    g.getChildren().add(t);

    root.getChildren().add(g);
    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Text t1 = new Text("Drop Shadow!");
    t1.setFont(Font.font(24));/* w w  w  . j a v a2  s  .com*/
    t1.setEffect(new DropShadow());

    Text t2 = new Text("Blur!");
    t2.setFont(Font.font(24));
    t2.setEffect(new BoxBlur());

    Text t3 = new Text("Glow!");
    t3.setFont(Font.font(24));
    t3.setEffect(new Glow());

    Text t4 = new Text("Bloom!");
    t4.setFont(Font.font("Arial", FontWeight.BOLD, 24));
    t4.setFill(Color.WHITE);
    t4.setEffect(new Bloom(0.10));

    Rectangle rect = new Rectangle(100, 30, Color.GREEN);
    StackPane spane = new StackPane(rect, t4);

    HBox root = new HBox(t1, t2, t3, spane);
    root.setSpacing(20);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Applying Effects");
    stage.show();
}

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("Keyboard");
    Group root = new Group();
    Scene scene = new Scene(root, 530, 300, Color.WHITE);

    final StringProperty statusProperty = new SimpleStringProperty();

    InnerShadow iShadow = InnerShadowBuilder.create().offsetX(3.5f).offsetY(3.5f).build();
    final Text status = TextBuilder.create().effect(iShadow).x(100).y(50).fill(Color.LIME)
            .font(Font.font(null, FontWeight.BOLD, 35)).translateY(50).build();
    status.textProperty().bind(statusProperty);
    statusProperty.set("Line\nLine2\nLine");
    root.getChildren().add(status);// ww  w.  j  a  v a  2 s . c om

    primaryStage.setScene(scene);
    primaryStage.show();
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Group g = new Group();
    final Scene scene = new Scene(g, 300, 250);
    scene.setFill(null);//  w  w w .  ja va 2 s. c  o  m

    Light.Spot light = new Light.Spot();
    light.setX(0);
    light.setY(100);
    light.setZ(50);
    light.setPointsAtX(400);
    light.setPointsAtY(0);
    light.setPointsAtZ(0);
    light.setSpecularExponent(2);

    Lighting l = new Lighting();
    l.setLight(light);
    l.setSurfaceScale(5.0);

    Text t = new Text();
    t.setText("Spot");
    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);

    Rectangle r = new Rectangle();
    r.setFill(Color.BLACK);

    g.getChildren().add(r);
    g.getChildren().add(t);

    r.setWidth(t.getLayoutBounds().getWidth() + 30);
    r.setHeight(t.getLayoutBounds().getHeight() + 20);

    stage.setScene(scene);
    stage.show();
}

From source file:de.pixida.logtest.designer.automaton.ConfigFrame.java

ConfigFrame(final String aTitle) {
    Validate.notNull(aTitle);/*from  w  w  w.  j a  va 2s .co  m*/
    this.title = aTitle;

    this.setHbarPolicy(ScrollBarPolicy.NEVER);
    this.setFitToWidth(true);

    final int insets = 10;
    this.vbox.setPadding(new Insets(insets));
    final int spacing = 8;
    this.vbox.setSpacing(spacing);

    final Text titleText = new Text(this.title);
    final int titleFontSize = 14;
    titleText.setFont(Font.font(Font.getDefault().getFamily(), FontWeight.BOLD, titleFontSize));
    this.vbox.getChildren().add(titleText);

    this.setContent(this.vbox);

    final int minWidth = 200;
    this.setMinWidth(minWidth);
}