• Post Reply Bookmark Topic Watch Topic
  • New Topic

interface updating  RSS feed

 
Lorenzo Levrini
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry about the other two threads, It simply cut off the contents halfway, it wouldn't display the rest!

I'll try and express my problem more concisely.

I have invented a new component Histogram which extends JComponent.

I have an array[] of histogram objects.

I'm displaying a array[0] in a pane on my GUI, and I have a method update() which puts a new, different Histogram object in array[0]. I want the GUI to automatically reflect this change by displaying the new array[0] component instead of the old one.

How do I do this?

Thanks!
 
Lorenzo Levrini
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Formulated even better:

Is there any way to have a component (1) that just holds a reference to another component (2) so that I can change 2 to something else and called component1.setRef(another component) and thereby add component1 to the interface once and change the displayed component by calling component1.setRef(another component)?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!