See JDK-7151452: JTabbedPane -> SCROLL_TAB_LAYOUT -> minimum/preferred size

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • tbd
    • Affects Version/s: 8
    • Component/s: client-libs

      FULL PRODUCT VERSION :


      A DESCRIPTION OF THE PROBLEM :
      Ocurred in jdk 1.6.0_21 but seems to be inherent for me in jdk 1.8

      BasicTabbedPaneUI does not take the tabAreaInsets into consideration, calculating the preferredTabAreaHeight/Width when getTabLayoutPolicy() == SCROLL_TAB_LAYOUT

      Replacing BasicTabbedPaneUI.TabbedPaneScrollLayout

              protected int preferredTabAreaHeight(int tabPlacement, int width) {
                  return calculateMaxTabHeight(tabPlacement);
              }

              protected int preferredTabAreaWidth(int tabPlacement, int height) {
                  return calculateMaxTabWidth(tabPlacement);
              }

      with

              protected int preferredTabAreaHeight(int tabPlacement, int width) {
                  int maxTabHeight = calculateMaxTabHeight(tabPlacement);
                  return calculateTabAreaHeight(tabPlacement, 1, maxTabHeight);
              }

              protected int preferredTabAreaWidth(int tabPlacement, int height) {
                  int maxTabWidth = calculateMaxTabWidth(tabPlacement);
                  return calculateTabAreaWidth(tabPlacement, 1, maxTabWidth);
              }

      may fix this.


      REPRODUCIBILITY :
      This bug can be reproduced always.

            Assignee:
            Prasanta Sadhukhan
            Reporter:
            Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: