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

[TabPane] If first tab is disabled, its content is still shown at startup

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8, 8u20
    • Fix Version/s: 8u20
    • Component/s: javafx
    • Labels:
      None

      Description

      Run code below, and note that the 'Hello world!' text is shown even though the button is contained within a disabled tab.

      import javafx.application.Application;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.Tab;
      import javafx.scene.control.TabPane;
      import javafx.stage.Stage;

      public class App extends Application {


          @Override
          public void start(Stage stage) {

              TabPane pane = new TabPane();
              final Tab disabled = new Tab("Disabled");
              disabled.setContent(new Button("Hello world!"));
              disabled.setDisable(true);
              pane.getTabs().add(disabled);

              pane.getTabs().addAll(new Tab("ABCABCABCABC"), new Tab("ABC"));

              Scene scene = new Scene(pane,200,200);
              stage.setScene(scene);
              stage.show();

          }

          public static void main(String[] args) {
              Application.launch(args);
          }
      }

        Attachments

          Activity

            People

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            jgiles Jonathan Giles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: