>>>>> "Max" == Max Rydahl Andersen <[EMAIL PROTECTED]> writes:
Max> Hello lehmann2,
Max> My quick answer would be to instead subclass Document and then check wether
Max> something are inserted in the document and then enableButtons()....
Max> Look at the Document interface and setModel on JTextField.
In general, this is a cleaner approach than checking for keypresses. In the
case of the original question, think about what should happen if your text
field already contains a single character, and the user first adds a character,
and then deletes the character they added, returning the text field to its
original state. It's not unreasonable to think that your buttons should now be
disabled at this point. This sort of thing is easier to do if you use the
Document feature, and not check for keypresses.
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
[EMAIL PROTECTED]
_______________________________________________
Swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/swing