Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2006

Tip: Looking for answers? Try searching our database.

Determine which frame called windowActivated

Thread view: 
Ben - 19 Mar 2006 20:01 GMT
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/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.