• Post Reply Bookmark Topic Watch Topic
  • New Topic

Send data between two internal frames

 
Jean-Yves Tinevez
Greenhorn
Posts: 22
Eclipse IDE Mac Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone!

Sorry, i already asked this question on java beginner, but didn't get any feedback. And i could use some help...

I have a JFrame that contains two internal frames.
I would like the first one to send data to be displayed on the second internal frame. (Context: the first one contains a list of parameters saved on the hard drive. When the user double-click on one of them, they are loaded. I would like the second one to display these data).

I have tried to read as much as possible, and it seems that using an event listener might be the solution. But i don't see how i could have the second frame to be aware of an event in the first one, because they are separated classes.
The 'Java Head First' book gave me an hint, stating that one class should be nested within another one, but that's not very elegant when the two classes are JInternalFrame.

Am i completely confused ?....
jy
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's a simple example of a comboBox controlling the contents of a 2nd comboBox

http://www.coderanch.com/t/380078/java/java/JComboBoxes

this will depend on what components you have in the internalFrames.

> But i don't see how i could have the second frame to be aware of an event in
> the first one, because they are separated classes.

internalFrame1() only needs a reference to internalFrame2() (or the component)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!