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

TabPane setTabMaxWidth hides close button

    XMLWordPrintable

Details

    Description

      When TabPane tabMaxWidth is specified greater than tabs actual width, then close button is hidden.

      public class TabPaneCloseBug extends Application {

          @Override
          public void start(Stage primaryStage) throws Exception {
              final TabPane tabs = new TabPane();
              tabs.setTabClosingPolicy(TabPane.TabClosingPolicy.ALL_TABS);
              tabs.getTabs().setAll(new Tab("A"),new Tab("B"),new Tab("C"));
              tabs.setTabMaxWidth(200);//remove this line to see close buttons
              //tabs.setTabMinWidth(200); //or make tabs wider to see close buttons

              Scene scene = SceneBuilder.create()
                      .width(1000).height(700)
                      .root(tabs).build();

              primaryStage.setScene(scene);
              primaryStage.setTitle("TabPaneCloseBug");
              primaryStage.show();
          }

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

      Attachments

        Activity

          People

            jgiles Jonathan Giles
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: