Hi, the following patch fixes the painting of the BasicArrowButton. The main problem was that the center point was calculated with the use of getBounds().x and that value is in the coordinate space of the parent's component. I removed that and simplified the method a bit.
ChangeLog: 2006-07-05 Robert Schuster <[EMAIL PROTECTED]> * javax/swing/plaf/basic/BasicArrowButton.java: (paint): Removed getBounds() call, changed center point calculation.
Index: javax/swing/plaf/basic/BasicArrowButton.java =================================================================== RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicArrowButton.java,v retrieving revision 1.20 diff -u -r1.20 BasicArrowButton.java --- javax/swing/plaf/basic/BasicArrowButton.java 15 Jun 2006 18:33:31 -0000 1.20 +++ javax/swing/plaf/basic/BasicArrowButton.java 5 Jul 2006 13:37:25 -0000 @@ -1,5 +1,5 @@ /* BasicArrowButton.java -- - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. This file is part of GNU Classpath. @@ -162,16 +162,20 @@ public void paint(Graphics g) { super.paint(g); - Rectangle bounds = getBounds(); - int size = bounds.height / 4; - int x = bounds.x + (bounds.width - size) / 2; - int y = (bounds.height - size) / 4; + + int height = getHeight(); + int size = height / 4; + + int x = (getWidth() - size) / 2; + int y = (height - size) / 2; + ButtonModel m = getModel(); if (m.isArmed()) { x++; y++; } + paintTriangle(g, x, y, size, direction, isEnabled()); }
signature.asc
Description: OpenPGP digital signature