• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Send data between two internal frames

 
Greenhorn
Posts: 22
Mac Eclipse IDE Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
 
You have to be odd to be #1 - Seuss. An odd little ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic