aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JFrame / JDialog communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JFrame / JDialog communication" Watch "JFrame / JDialog communication" New topic
Author

JFrame / JDialog communication

Rick Crawford
Ranch Hand

Joined: Aug 17, 2001
Posts: 34
I have a situation very similar to the one described in this link: http://www.javaranch.com/ubb/Forum2/HTML/001601.html
What I'm wanting to do is reference a member variable within the class that started up the instance of the dialog. In other words, once the dialog (a descendant of JDialog) is started, I want him to be able to 'see' a variable within the parent JFrame.
I'm very new to Swing. Is there some sort of getParentObjectThatStartedMeUp method that I could use to refer back to the JFrame?
Thanks for any help,
Rick Crawford
[This message has been edited by Rick Crawford (edited September 24, 2001).]
Paul Stevens
Ranch Hand

Joined: May 17, 2001
Posts: 2823
If you passed the parent frame into the JDialog constructor, you already have the reference. Just save it.
API JDialog(Frame owner, boolean modal) or JDialog(Frame owner)
Rick Crawford
Ranch Hand

Joined: Aug 17, 2001
Posts: 34
That did it! You 'da man!
Thanks for the help,
Rick Crawford
 
Consider Paul's rocket mass heater.
 
subject: JFrame / JDialog communication