title: how to make change in one class take effect in another class?
body: <p>I'm designing GUI of a download manager in java, in the main frame of the program (which is a JFrame) there are several buttons, one of them is Settings button which opens into a JDialog, in Settings section user can choose between several default look and feels (like steel, Nimbus etc).<br>
  the problem is, I want to apply the change of look and feel to both Setting section and mainframe but as Setting section is a different frame and class, the change just takes effect in Settings frame, I don't know how to make this change affect the main panel.<br>
  Code (part of Settings class):</p>
  
  <pre><code>UIManager.LookAndFeelInfo[] LAFInfo = UIManager.getInstalledLookAndFeels();
  String [] LookAndFeels = new String[LAFInfo.length];
  for (int i = 0; i &lt; LAFInfo.length; i++) {
      LookAndFeels [i] =  LAFInfo[i].getName();
      JComboBox&lt;String&gt; lookAndFeelChoices = new JComboBox&lt;&gt;(LookAndFeels);
      lookAndFeelChoices.setBounds(200,220,200,30);
      settings.add(lookAndFeelChoices);
      lookAndFeelChoices.addItemListener(new ItemListener() {
          @Override
          public void itemStateChanged(ItemEvent e) {
              try {
                  UIManager.setLookAndFeel(LAFInfo[lookAndFeelChoices.getSelectedIndex()].getClassName());
                  SwingUtilities.updateComponentTreeUI(Settings.super.getContentPane())
              } catch (Exception ei) {
                  System.out.println(ei);
              }
          }
      });
  }
  </code></pre>