File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Internal Frames(urgent.....please!) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Internal Frames(urgent.....please!)" Watch "Internal Frames(urgent.....please!)" New topic

Internal Frames(urgent.....please!)

Big Mike

Joined: Jul 17, 2001
Posts: 4
I have an application that spawns numerous internal frames. I need to detect which internal frame throws an event ans close that specific one.
When I create an instance of the internal frame, I add a vetoableChangeListener to it. Each internal frame is createdd the same exact way and the listener add likewise. How do I know that internal frame1 generated the event or if internal frame6 generated it.
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
Either you need a separate listener for each frame, or you need to add the same listener to all the frames and then have it ask the event what its source was:

I would personally create a separate listener for each frame.

[This message has been edited by Cindy Glass (edited August 21, 2001).]

"JavaRanch, where the deer and the Certified play" - David O'Meara
Big Mike

Joined: Jul 17, 2001
Posts: 4
Hey cindy, thanks for your suggestion and the latter is what I have chosen. It is working quite lovely.
Consider Paul's rocket mass heater.
subject: Internal Frames(urgent.....please!)
jQuery in Action, 3rd edition