• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JFrame / JDialog communication

 
Rick Crawford
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That did it! You 'da man!
Thanks for the help,
Rick Crawford
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic