If your UI uses the InputVerifier introduced with JDK 1.3, you might want to
vote for a bug recently made public on Sun's BugParade. I'm hoping we can
convince Sun to go the 'extra step' and make the InputVerifier truly useful.


The InputVerifier has some advantages over a FocusListener (like its ability
to control whether a component trips the InputVerifier), but it also has
some quirks. The biggest problem is that the mouse events are still
transmitted to other components even if a validation field (like a
JTextField in which a user types a date) retains focus when the
InputVerifier determines that the user's input in invalid. Because mouse
events are not blocked, the UI can be left in an inconsistent state. For
instance, a JComboBox's popup will still popup and a JButton will still
appear pressed even if the InputVerifier prevents these components from
getting focus. Sun claims that they intended the InputVerifier to control
focus and not the propogation of mouse events. Maybe so, but the resulting
problems make a Swing UI look unprofessional.

Here are the two bugs. Vote for them if you are interested in getting the
problems fixed.

This is the more fundamental problem:

http://developer.java.sun.com/developer/bugParade/bugs/4533820.html

  "Extend InputVerifiers to keep events from firing on target components"

This is a more specific problem:

http://developer.java.sun.com/developer/bugParade/bugs/4368790.html

  "JButton stays pressed when focus stolen"
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to