Example usage for javafx.scene.control Button setEffect

List of usage examples for javafx.scene.control Button setEffect

Introduction

In this page you can find the example usage for javafx.scene.control Button setEffect.

Prototype

public final void setEffect(Effect value) 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("Close");
    b1.setEffect(new DropShadow());

    VBox root = new VBox();
    root.getChildren().addAll(b1);//w w  w  . j av a2  s  .  c  om

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Testing LayoutBounds");
    stage.show();

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("Close");
    b1.setEffect(new DropShadow());

    Button b3 = new Button("Close");
    b3.setEffect(new DropShadow());
    b3.setRotate(30);// w w w  .j a  v a  2  s  . c o m

    VBox root = new VBox();
    root.getChildren().addAll(b1, b3);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Testing LayoutBounds");
    stage.show();

    System.out.println("b1=" + b1.getLayoutBounds());
    System.out.println("b3=" + b3.getLayoutBounds());
}

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("Close");
    b1.setEffect(new DropShadow());

    Button b2 = new Button("Close");

    Button b3 = new Button("Close");
    b3.setEffect(new DropShadow());
    b3.setRotate(30);//w ww  .j ava 2s . co m

    Button b4 = new Button("Close");

    VBox root = new VBox();
    root.getChildren().addAll(b1, b2, b3, b4);

    Scene scene = new Scene(root);
    stage.setScene(scene);
    stage.setTitle("Testing LayoutBounds");
    stage.show();

}

From source file:Main.java

@Override
public void start(Stage stage) {
    Scene scene = new Scene(new Group());
    stage.setTitle("Button Sample");
    stage.setWidth(300);//w  w  w  .j  a v  a 2  s.  c om
    stage.setHeight(190);

    VBox vbox = new VBox();
    vbox.setLayoutX(20);
    vbox.setLayoutY(20);

    final Button button1 = new Button("Accept");

    button1.addEventHandler(MouseEvent.MOUSE_ENTERED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent e) {
            button1.setEffect(shadow);
        }
    });

    button1.addEventHandler(MouseEvent.MOUSE_EXITED, new EventHandler<MouseEvent>() {
        @Override
        public void handle(MouseEvent e) {
            button1.setEffect(null);
        }
    });

    vbox.getChildren().add(button1);
    vbox.setSpacing(10);
    ((Group) scene.getRoot()).getChildren().add(vbox);

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