classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: fix for JSplitPane


From: Roman Kennke
Subject: [cp-patches] FYI: fix for JSplitPane
Date: Wed, 25 May 2005 10:39:17 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

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  <address@hidden>

       * 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);
   }
 
   /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]