[Tab] Tab content is not disabled when tab is disabled before content is set

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 10
    • Affects Version/s: 9
    • Component/s: javafx

      When the tab is disabled before setting the content to tab,
      the content are displayed normally in the Tab.

      Below is the sample code to reproduce the issue.
      Note that, tab is disabled -> aTab.setDisable(true);
      before setting the content to the tab, aTab.setContent(vBox);

      STEPS TO OBSERVE THE ISSUE:
      1. Execute the below code.
      2. Observe that the Tab will be disabled but the 2 buttons are enabled & can be clicked.
      3. Refer attached screenshot.
      ---------------------------------------
      public class test extends Application {

          @Override
          public void start(final Stage primaryStage) throws Exception {
              final TabPane tabPane = new TabPane();
              Tab aTab = new Tab("Disabled Tab");
              tabPane.getTabs().add(aTab);
              // Disable tab before setting content
              aTab.setDisable(true);
              VBox vBox = new VBox();
              Button b1 = new Button("Button 1");
              Button b2 = new Button("Button 2");
              vBox.getChildren().addAll(b1, b2);
              aTab.setContent(vBox);

              primaryStage.setScene(new Scene(tabPane));
              primaryStage.setWidth(200);
              primaryStage.setHeight(200);
              primaryStage.show();
          }

          public static void main(final String[] args) {
              launch(args);
          }
      }
      ---------------------------------------

            Assignee:
            Ambarish Rapte
            Reporter:
            Ambarish Rapte
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: