Implementing a focusListener per JComponent although works for a limited nos of components, is quite long and drawn out when you have many fields to provide validation.
Why don't you use an InputVerifer class, you can then centralise all your validation logic in one place and do not need to...
Alternatively, if you have access to Tiger then you can start using more advanced formatting functionality with the inbuilt Formatter class :
The Formatter class also has the ability to make it much easier to read formatted input.
Usage
Formatter myFormatter=new Formatter()...
Tim, thanks alot your right I should have called the super methods, not quite sure how I managed to forget the implementation.
Re:
__
Incidentally, since you still have to add elements to your model class via a non-type safe addElement(Object o) method your not getting anything by subclassing...
I would like to use a JList to display employee information and allow add/delete operations on this JList.
I am having a problem when adding/removing a record from the JList, the model is being updated but the JList goes blank.
I do not use Arrays, Vectors etc to maintain my model. My model...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.