<Swing Dev> [13] RFR JDK-8215396: JTabbedPane preferred size calculation is wrong for SCROLL_TAB_LAYOUT
Prasanta Sadhukhan
prasanta.sadhukhan at oracle.com
Wed Feb 27 10:25:20 UTC 2019
Hi All,
Please review a fix for an issue where it is seen that for
SCROLL_TAB_LAYOUT the border of the content of JTabbedPane is not fully
shown, whereas for WRAP_TAB_LAYOUT policy, the content is fully shown.
It seems BasicTabbedPaneUI.TabbedPaneScrollLayout inner class (used for
SCROLL_TAB_LAYOUT) has preferredTabAreaHeight() and
preferredTabAreaWidth() which are overridden from
its superclass, BasicTabbedPaneUI.TabbedPaneLayout (used for
WRAP_TAB_LAYOUT). In superclass, these methods take into account the tab
area insets, but the overridden methods in TabbedPaneScrollLayout don't.
Proposed fix is to use existing methods
[calculateTabAreaHeight,calculateTabAreaWidth] for calculating the size
as was done for WRAP_TAB_LAYOUT.
Bug: https://bugs.openjdk.java.net/browse/JDK-8215396
webrev: http://cr.openjdk.java.net/~psadhukhan/8215396/webrev.0/
Regards
Prasanta
More information about the swing-dev
mailing list