The layoutCompoundLabel method (used by many Swing components) had a bug
that could lead to invisible labels. This was the case when the
verticalTextPosition is set to BOTTOM and there is no icon. In this case
the method laid out the label at a negative position, thus shifting it
outside of the view rectangle and therefore making it invisible. This is
fixed.
2005-09-23 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/SwingUtilities.java
(layoutCompoundLabel): Fix the case when verticalTextPosition=BOTTOM
and without icon. The label text slipped out of the view rectangle
in this case.
/Roman
Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
retrieving revision 1.35
diff -u -r1.35 SwingUtilities.java
--- javax/swing/SwingUtilities.java 15 Sep 2005 20:24:14 -0000 1.35
+++ javax/swing/SwingUtilities.java 23 Sep 2005 08:50:54 -0000
@@ -890,7 +890,9 @@
iconR.y = 0;
textR.y = (horizontalTextPosition == CENTER
? iconR.height + textIconGap
- : iconR.height - textR.height);
+ : Math.max(iconR.height - textR.height, 0));
+ System.err.println("iconR.height: " + iconR.height);
+ System.err.println("textR.height: " + textR.height);
break;
case CENTER:
int centerLine = Math.max(textR.height, iconR.height) / 2;_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches