Example usage for javafx.scene.control Tab selectedProperty

List of usage examples for javafx.scene.control Tab selectedProperty

Introduction

In this page you can find the example usage for javafx.scene.control Tab selectedProperty.

Prototype

public final ReadOnlyBooleanProperty selectedProperty() 

Source Link

Document

The currently selected tab.

Usage

From source file:mesclasses.view.JourneeController.java

private void initTab(Tab tab, SmartGrid grid) {
    tab.getContent().setManaged(false);/*from  w w w. j a v  a 2 s.  c om*/
    tab.getContent().setVisible(false);

    tab.selectedProperty().addListener((ob, o, n) -> {
        if (n) {
            selectTab(tab, grid);
        } else {
            unselectTab(tab);
        }
    });
}