Results 1 to 2 of 2
Thread: ActionListenrs - who first
- 10-28-2009, 11:05 AM #1
Member
- Join Date
- Dec 2008
- Posts
- 99
- Rep Power
- 0
- 10-28-2009, 03:39 PM #2
Senior Member
- Join Date
- Aug 2009
- Location
- Pittsburgh, PA
- Posts
- 282
- Rep Power
- 4
In what order are listeners called?
Listeners are called in an order determined by the object they are added to.
Often this is the same order as the calls to addListener.
Often the applications listeners are called after the internal listeners.
But, in general, you cannot predict the order of calls.
This deficiency is one reason for Swing's glasspane object and
the KeyboardFocusManager. They provide hooks to do things
before the regular event processing begins.
If you really want to produce a fragile application, you can
read the code of an addListener method and see what order it creates.
Your own code could then fetch all the listeners (Component.getListeners())
and reinsert them in a desired order.
Good luck.


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks