Hi, I would like to limit the number of characters to 10 and also limit the characters to only digits that can be entered into a JTextField. Can I safely use awt events on JTextField or do I have to use only Document? Thanks in advance.
posted 15 years ago
I'd suggest to use the Document, as described in the Tutorial. Take advantage of the MVC architecture of Swing: the model (Document) contains the text, the view/controler (JTextField) displays/controls it.