Example usage for javafx.scene.effect InnerShadow setOffsetX

List of usage examples for javafx.scene.effect InnerShadow setOffsetX

Introduction

In this page you can find the example usage for javafx.scene.effect InnerShadow setOffsetX.

Prototype

public final void setOffsetX(double value) 

Source Link

Usage

From source file:Main.java

static Node innerShadow() {
    InnerShadow is = new InnerShadow();
    is.setOffsetX(2.0f);
    is.setOffsetY(2.0f);/*from w  w w  . j a  va  2s  . c  om*/

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

    t.setTranslateX(300);
    t.setTranslateY(300);

    return t;
}

From source file:Main.java

@Override
public void start(Stage stage) {
    stage.setTitle("HTML");
    stage.setWidth(500);//  w  ww. j a v a2 s . c om
    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();
}