• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing object persistence

 
Jim Henessey
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm wondering if there's an alternative, more efficient way of doing something
I'm trying to do:

I have a class which generates a frame, which in turn contains two panels. The panel on the right contains a combobox which, when selected, changes the image in the left panel.

Right now for things to work properly, I have to pass the left panel object to the class which creates the right panel, which in turn passes the left panel object to the combo box's action listener.

Is there any way of getting around this? Is it possible to reference an object created outside of a specific class, without it being passed (either as a parameter or through methods) to that class?

If the information is out there, pointing me in the right direction is sufficient - I just haven't managed to find the answer to this so far.

Thanks in advance.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!