I have a number of JFrames that call the same
windowActivated(WindowEvent we). How do I determine which frame caused
the event.
Thanks.
Ben.
Greg Webber - 19 Mar 2006 20:17 GMT
I haven't yet used windowActivated, but would this work?
Object src = we.getSource();
if(src == oneJFrame){
doStuff();
}else if(src == otherJFrame){
doSomethingElse();
}
> I have a number of JFrames that call the same
> windowActivated(WindowEvent we). How do I determine which frame caused
[quoted text clipped - 3 lines]
>
> Ben.

Signature
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT/MU/O d-(++) s++: a-- C++++>$ UL++ P+ L+++>++++$ E- W+++>$ N++
o?>+ K+ w--- O?>O+ M?>+ V- PS@ PE+ Y+ PGP t+@ !5 X R+ tv++@ b++>+++ DI++
D+ G++ e- h! r- y-
------END GEEK CODE BLOCK------
http://friedoysters.hollosite.com/forum/index.php
Thomas Weidenfeller - 20 Mar 2006 09:14 GMT
> I have a number of JFrames that call the same
> windowActivated(WindowEvent we). How do I determine which frame caused
> the event.
The best would be to provide them with separate event handlers. What is
the point in first merging something (the otherwise independent events),
and then trying to separate things once they are merged?
If you really want to mess with one handler only, evaluate the event's
source.
/Thomas

Signature
The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/