How do you cause an action that occurs in one frame/dialog to create an action in another frame?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Robert_Langley
Posted On:   Monday, March 6, 2006 12:03 AM

I'm completely lost here mostly due to the fact that I'm unfamiliar with all of jbuilder's jargon so looking it up in a tutorial is an impossibility for me at the moment due to time constraints. Anyway, I created a new Application in a project and afterwards I went into New.. and selected dialog. If I wanted a button in the the dialog window to append some text to a text area in the other frame how would I go about doing that? For the action event of the button in the dialog I tried: Frame1 fram; fram.jTextArea1.append("some text"); Which didn't work but I just wanted to give an idea on how completely lost I am. Step by step help or even just the term used to describe this process would be much appreciated.    More>>


I'm completely lost here mostly due to the fact that I'm unfamiliar with all of jbuilder's jargon so looking it up in a tutorial is an impossibility for me at the moment due to time constraints. Anyway, I created a new Application in a project and afterwards I went into New.. and selected dialog. If I wanted a button in the the dialog window to append some text to a text area in the other frame how would I go about doing that? For the action event of the button in the dialog I tried:
Frame1 fram;
fram.jTextArea1.append("some text");
Which didn't work but I just wanted to give an idea on how completely lost I am.
Step by step help or even just the term used to describe this process would be much appreciated.

   <<Less

Re: How do you cause an action that occurs in one frame/dialog to create an action in another frame?

Posted By:   Benjamin_Toso  
Posted On:   Tuesday, April 18, 2006 01:50 PM

If I understand what you are asking you could:


  • Make the frame or some component in the frame that contains the button implement ActionListener.

  • Somehow give the ActionListener component a handle to the other frame's text box.
  • Use the button's addActionListener() to assign the action listener in the first step.
  • In the actionPerformed() method on the listener, add the desired text using the handle above.




Another more general way would be to implement your own simple publish-subscribe.
About | Sitemap | Contact