Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8181213

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

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 10
    • 9
    • javafx

    Description

      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);
          }
      }
      ---------------------------------------

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: