<Swing Dev> JViewport fixlet

Roman Kennke roman.kennke at aicas.com
Mon Sep 24 10:47:18 UTC 2007

I just stumbled over this code in JViewport.setViewPosition():

       if (view instanceof JComponent) {
           JComponent c = (JComponent)view;
           oldX = c.getX();
           oldY = c.getY();
       else {
           Rectangle r = view.getBounds();
           oldX = r.x;
           oldY = r.y;

I think this special casing is not necessary anymore since JDK1.2.
Attached is a patch to correct this.

Cheers, Roman

Dipl.-Inform. (FH) Roman Kennke, Software Engineer, http://kennke.org
aicas Allerton Interworks Computer Automated Systems GmbH
Haid-und-Neu-Straße 18 * D-76131 Karlsruhe * Germany
http://www.aicas.com   * Tel: +49-721-663 968-0
USt-Id: DE216375633, Handelsregister HRB 109481, AG Karlsruhe
Geschäftsführer: Dr. James J. Hunt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jviewport.diff
Type: text/x-patch
Size: 720 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20070924/913608d1/jviewport.diff>

More information about the swing-dev mailing list