A small fix for limewire.

2006-06-12  Lillian Angel  <[EMAIL PROTECTED]>

        * javax/swing/plaf/basic/BasicTabbedPaneUI.java
        (layoutContainer): Added check to prevent exception.

Index: javax/swing/plaf/basic/BasicTabbedPaneUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTabbedPaneUI.java,v
retrieving revision 1.46
diff -u -r1.46 BasicTabbedPaneUI.java
--- javax/swing/plaf/basic/BasicTabbedPaneUI.java	9 Jun 2006 23:34:34 -0000	1.46
+++ javax/swing/plaf/basic/BasicTabbedPaneUI.java	12 Jun 2006 16:06:43 -0000
@@ -532,7 +532,10 @@
       Insets insets = tabPane.getInsets();
 
       int selectedIndex = tabPane.getSelectedIndex();
-      Component selectedComponent = tabPane.getComponentAt(selectedIndex);
+      
+      Component selectedComponent = null;
+      if (selectedIndex >= 0)
+        tabPane.getComponentAt(selectedIndex);
       // The RI doesn't seem to change the component if the new selected
       // component == null. This is probably so that applications can add
       // one single component for every tab. 

Reply via email to