Hi,

as reported here: https://savannah.gnu.org/bugs/?func=detailitem&item_id=13164, the JSplitPane has a problem when it shows up. The attached fix includes a check if the divider has a valid location (according to the minimum/maximum sizes of its components).

This should fix bug#13164

2005-05-25  Roman Kennke  <[EMAIL PROTECTED]>

       * javax/swing/plaf/basic/BasicSplitPaneUI.java
       (paint): Added check to make sure the split pane divider has
       a valid location.

/Roman
Index: javax/swing/plaf/basic/BasicSplitPaneUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicSplitPaneUI.java,v
retrieving revision 1.7
diff -u -r1.7 BasicSplitPaneUI.java
--- javax/swing/plaf/basic/BasicSplitPaneUI.java        23 Oct 2004 20:55:04 
-0000      1.7
+++ javax/swing/plaf/basic/BasicSplitPaneUI.java        25 May 2005 08:35:22 
-0000
@@ -1348,7 +1348,11 @@
    */
   public void paint(Graphics g, JComponent jc)
   {
-    // Do nothing. All the painting is handled by children.
+    // Make sure that the location is valid
+    int divLoc = splitPane.getDividerLocation();
+    int valLoc = validLocation(divLoc);
+    if (divLoc != valLoc)
+      splitPane.setDividerLocation(valLoc);
   }
 
   /**
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to