You should use the MVC -pattern instead and let the two 'Views' share the same 'Model' (the 'Controller' -part is handled by the component itself). Hope it helps.
/S
public class FrameTest extends JFrame {
Object[] items = new Object[]{"One", "Two", "Three"};
JComboBox jCombo1 = new JComboBox(items);
JComboBox jCombo2 = new JComboBox(jCombo1.getModel());
public FrameTest() {
getContentPane().setLayout(new BorderLayout());
getContentPane().add(jCombo1, java.awt.BorderLayout.NORTH);
getContentPane().add(jCombo2, java.awt.BorderLayout.SOUTH);
this.setSize(200, 100);
this.setVisible(true);
}
public static void main(String args[]) {
new FrameTest();
}
}
|