7034619: Scrollable Tabs don't appear with JDK7 Synth based LaF, different from Java 5/6
authorkizune
Tue, 10 May 2011 17:06:26 +0400
changeset 9667 b8c4fd770967
parent 9666 b373390818b7
child 9668 13c8e69958e6
7034619: Scrollable Tabs don't appear with JDK7 Synth based LaF, different from Java 5/6 Reviewed-by: alexp
jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java
--- a/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java	Fri May 06 16:01:17 2011 +0400
+++ b/jdk/src/share/classes/javax/swing/plaf/synth/SynthTabbedPaneUI.java	Tue May 10 17:06:26 2011 +0400
@@ -488,6 +488,18 @@
         paintContentBorder(tabContentContext, g, tabPlacement, selectedIndex);
     }
 
+    protected void paintTabArea(Graphics g, int tabPlacement,
+                                int selectedIndex) {
+        // This can be invoked from ScrollabeTabPanel
+        Insets insets = tabPane.getInsets();
+        int x = insets.left;
+        int y = insets.top;
+        int width = tabPane.getWidth() - insets.left - insets.right;
+        int height = tabPane.getHeight() - insets.top - insets.bottom;
+
+        paintTabArea(tabAreaContext, g, tabPlacement, selectedIndex,
+                     new Rectangle(x, y, width, height));
+    }
 
     private void paintTabArea(SynthContext ss, Graphics g,
                                 int tabPlacement, int selectedIndex,