Hi,
by calling the getTabRunOverlay method from
BasicTabbedPaneUI.calculateTabAreaWidth (and calculateTabAreaHeight) instead of
accessing the variable directly the overridden behavior in MetalTabbedPaneUI
comes to effect.

This fixes the ill positioning of the content area in tabbed panes with more
than 2 tab runs (like in our Swing demo).

ChangeLog:

2006-09-01  Robert Schuster  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicTabbedPaneUI.java:
        (calculateTabAreaHeight): Use getTabRunOverlay method instead
        of accessing variable directly.
        (calculateTabAreaWidth): Dito.

cya
Robert
Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v
retrieving revision 1.55
diff -u -r1.55 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java	24 Aug 2006 17:29:28 -0000	1.55
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java	1 Sep 2006 07:16:29 -0000
@@ -902,6 +902,7 @@
             default:
               tabAreaHeight = calculateTabAreaHeight(tabPlacement, runCount,
                                                      maxTabHeight);
+            
               compX = insets.left + contentBorderInsets.left;
               compY = tabAreaHeight + insets.top + contentBorderInsets.top;
           }
@@ -3528,7 +3529,8 @@
   {
     Insets insets = getTabAreaInsets(tabPlacement);
     int tabAreaHeight = horizRunCount * maxTabHeight
-                        - (horizRunCount - 1) * tabRunOverlay;
+                        - (horizRunCount - 1)
+                        * getTabRunOverlay(tabPlacement);
 
     tabAreaHeight += insets.top + insets.bottom;
 
@@ -3550,7 +3552,8 @@
   {
     Insets insets = getTabAreaInsets(tabPlacement);
     int tabAreaWidth = vertRunCount * maxTabWidth
-                       - (vertRunCount - 1) * tabRunOverlay;
+                       - (vertRunCount - 1)
+                       * getTabRunOverlay(tabPlacement);
 
     tabAreaWidth += insets.left + insets.right;
 

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to