Oddly, this seems to also have fixed a problem with the vertical alignment of text in editable JComboBoxes under the MetalLookAndFeel. I'm very happy about that...

Regards,

Dave

Roman Kennke wrote:

I committed this little fixlet for the BasicTextUI. This should solve the
problem with textfields where the text is slightly off when displaying
right-aligned.

2005-11-09  Roman Kennke  <[EMAIL PROTECTED]>

       * javax/swing/plaf/basic/BasicTextUI.java
       (getVisibleEditorRect): Correctly calculate the inner rectangle.

/Roman
------------------------------------------------------------------------

Index: javax/swing/plaf/basic/BasicTextUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextUI.java,v
retrieving revision 1.52
diff -u -r1.52 BasicTextUI.java
--- javax/swing/plaf/basic/BasicTextUI.java     8 Nov 2005 15:03:11 -0000       
1.52
+++ javax/swing/plaf/basic/BasicTextUI.java     9 Nov 2005 10:19:42 -0000
@@ -831,10 +831,10 @@
  {
    Caret caret = textComponent.getCaret();
    Highlighter highlighter = textComponent.getHighlighter();
- +
    if (textComponent.isOpaque())
      paintBackground(g);
- +
    if (highlighter != null
        && textComponent.getSelectionStart() != textComponent.getSelectionEnd())
      highlighter.paint(g);
@@ -1064,8 +1064,8 @@
        
    Insets insets = textComponent.getInsets();
    return new Rectangle(insets.left, insets.top,
-                        width - insets.left + insets.right,
-                        height - insets.top + insets.bottom);
+                        width - insets.left - insets.right,
+                        height - insets.top - insets.bottom);
  }

  /**
------------------------------------------------------------------------

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



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

Reply via email to