Example usage for javafx.scene.control Tab isSelected

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

Introduction

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

Prototype

public final boolean isSelected() 

Source Link

Document

Represents whether this tab is the currently selected tab, To change the selected Tab use tabPane.getSelectionModel().select()

Usage

From source file:de.perdoctus.ebikeconnect.gui.MainWindowController.java

private void initActivitiesTab() throws Exception {
    final Parent parent = fxmlLoader.load(getClass().getResourceAsStream("/fxml/ActivitiesOverview.fxml"));
    this.activitiesOverviewController = fxmlLoader.getController();

    final Tab tab = new Tab(rb.getString("activities"));
    tab.setContent(parent);/*from w w w.  j  a v  a 2 s.com*/
    tabPane.getTabs().add(tab);

    tab.setOnSelectionChanged(event -> {
        if (tab.isSelected()) {
            activitiesOverviewController.reloadHeaders();
        }
    });

    mnuExport.disableProperty()
            .bind(activitiesOverviewController.currentActivityDetailsGroupProperty().isNull());
}