In the BasicTextUI.propertyChange() we fetch the new value of the
editable flag from the textcomponent itself. This would not work because
when the property event is fired, the component still has the old value.
This should fix the problem in the TextFieldDemo where changing the
editable flag does not update the textfield colors correctly.
2005-11-14 Roman Kennke <[EMAIL PROTECTED]>
* javax/swing/plaf/basic/BasicTextFieldUI.java
(propertyChange): Get new value from the PropertyChangeEvent and
not from the component itself (since when it receives the event,
the component still has the old state).
/Roman
Index: javax/swing/plaf/basic/BasicTextFieldUI.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicTextFieldUI.java,v
retrieving revision 1.5
diff -u -r1.5 BasicTextFieldUI.java
--- javax/swing/plaf/basic/BasicTextFieldUI.java 20 Sep 2005 18:03:10 -0000 1.5
+++ javax/swing/plaf/basic/BasicTextFieldUI.java 14 Nov 2005 12:15:58 -0000
@@ -90,7 +90,8 @@
{
if (event.getPropertyName().equals("editable"))
{
- if (textComponent.isEditable())
+ boolean editable = ((Boolean) event.getNewValue()).booleanValue();
+ if (editable)
textComponent.setBackground(background);
else
textComponent.setBackground(inactiveBackground);
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches