Forums Register Login

Send data between two internal frames

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
here's a simple example of a comboBox controlling the contents of a 2nd comboBox

https://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)
A sonic boom would certainly ruin a giant souffle. But this tiny ad would protect it:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1874 times.
Similar Threads
Opening a JInternalFrame in a JInternalFrame
Focusing in Frames
displaying content of first frame into second
Inter-Component communication in Swing
JInternalFrame iconifying size
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:53:01.