The problem is when the lostFocus occurs on a Component, the gainedFocus is already sent for the next
component in the SystemEventQueue. We must grab this event, and request the focus for the previous
component (if there is a validation error). We can't use Toolkit.getDefaultToolkit().getSystemEventQueue()
directly to remove the gainedFocus event because of security restriction in Applet.
This can be done with invokeLater method of the SwingUtilities class.