<Swing Dev> [13] RFR JDK-8215396: JTabbedPane preferred size calculation is wrong for SCROLL_TAB_LAYOUT

Sergey Bylokhov Sergey.Bylokhov at oracle.com
Wed Mar 6 01:05:15 UTC 2019


Hi, Prasanta.
The change looks fine, but I have two comments.
  - Please close the JDK-7151452 as a duplicate of JDK-8215396, since you sent JDK-8215396 to the review.
  - Looks like the test depends on the L&F, on my system it is passed on macOS on jdk11, probably it should checks all installe L&Fs?

On 27/02/2019 02:25, Prasanta Sadhukhan wrote:
> 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


-- 
Best regards, Sergey.


More information about the swing-dev mailing list