Example usage for javafx.scene.control Button isVisible

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

Introduction

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

Prototype

public final boolean isVisible() 

Source Link

Usage

From source file:Main.java

@Override
public void start(Stage stage) {
    Button b1 = new Button("B1");
    Button b2 = new Button("B2");
    Button b3 = new Button("B3");
    Button visibleBtn = new Button("Make Invisible");

    visibleBtn.setOnAction(e -> b2.setVisible(!b2.isVisible()));

    visibleBtn.textProperty().bind(new When(b2.visibleProperty()).then("Invisible").otherwise("Visible"));

    b2.managedProperty().bind(b2.visibleProperty());

    HBox root = new HBox();
    root.getChildren().addAll(visibleBtn, b1, b2, b3);

    Scene scene = new Scene(root);
    stage.setScene(scene);//from ww w  . j a va 2  s . c  om
    stage.setTitle("");
    stage.show();
}