Hi Lillian,

Lillian Angel wrote:

I fixed these 2 bugs. Attached is a patch file.

--- javax/swing/JViewport.java  27 May 2005 21:12:46 -0000      1.20
+++ javax/swing/JViewport.java  16 Jun 2005 16:56:53 -0000
@@ -344,6 +344,12 @@
          viewListener = createViewListener();
        v.addComponentListener(viewListener);
        add(v);
+ + Dimension vd = v.getPreferredSize();
+       Object p = getParent();
+       if (p instanceof JScrollPane && !vd.equals( new Dimension() ))
+               ( (JScrollPane) p ).setPreferredSize( vd );
+ fireStateChanged();
      }
  }
I don't think that we should mess with the preferredSize of the parent. Is there no other/better solution to these bugs? I would guess, that it must be something in ViewportLayout, which is responsible for resizing and repositioning the JList (or whatever child). If you think that your solution is correct, then maybe you could write a testcase that shows that the JDK is behaving like this too.

/Roman



_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to