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

TabPane setTabMaxWidth hides close button

    XMLWordPrintable

    Details

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

      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

            Assignee:
            jgiles Jonathan Giles
            Reporter:
            duke J. Duke (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved:
              Imported: