Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Forcing a Focus Gained event

0 views
Skip to first unread message

Dean Henkel

unread,
Oct 23, 1998, 3:00:00 AM10/23/98
to
Does anyone know how to force a focus gained event to a component using
the Event Queue.

One can get the event queue with:

new JButton myButton = new JButton("HELLO");

EventQueue evtq = Toolkit.getDefaultToolkit().getSystemEventQueue();

evtq.postEvent( new FocusEvent(this,FocusEvent.FOCUS_GAINED) );

Here's my question: The FocusEvent takes a source (this) but never
specifies a destination. What I want to do is have the my myButton get
the focus but I want it to happen in such a way that what ever component
currently has the focus would get properly notified through a FOCUS_LOST
event.

My assumption is that through normal processing a FOCUS_LOST event is
generated by some event manager when another component gains focus.

Thanks.


0 new messages