title: Change an object value from another method
body: <p>Following problem:</p>
  
  <p>I want to change one value to another, but from a different method. the full code (as requested) is as follows:</p>
  
  <pre><code>import javax.swing.*;
  import java.net.*;
  import java.awt.event.*;
  
  public class main {
  
      public static void about() {
          JDialog aboutWindow = new JDialog();
          aboutWindow.setTitle("About kingfisher a0.0.3");
          aboutWindow.setSize(300, 600);
          aboutWindow.setModal(true);
          JMenuBar menubar = new JMenuBar();
          JMenu control = new JMenu("Control");
          JMenuItem quit = new JMenuItem("quit");
  
          quit.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent event) {
                  aboutWindow.setVisible(false);
              }
          });
  
          control.add(quit);
          menubar.add(control);
          aboutWindow.add(menubar);
          JLabel name = new JLabel("kingfisher");
          aboutWindow.add(name);
      }
  
      public static void main(String args[]) {
          //Defined window dimensions
          JFrame controlpanel = new JFrame();
          controlpanel.setTitle("kingfisher a0.0.3");
          controlpanel.setSize(500, 400);
          controlpanel.add(new JLabel("The angels have the blue box"));
          JMenuBar menubar = new JMenuBar();
          //defining menu groups
          JMenu windows = new JMenu("Windows");
          JCheckBoxMenuItem chat = new JCheckBoxMenuItem("Chat");
          JCheckBoxMenuItem filetransfer = new JCheckBoxMenuItem("Filetransfer");
          JCheckBoxMenuItem settings = new JCheckBoxMenuItem("Settings");
          windows.add(chat);
          windows.add(filetransfer);
          windows.add(settings);
          JMenu control = new JMenu("Control");
          JMenuItem quit = new JMenuItem("Quit");
  
          quit.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent event) {
                  System.exit(0);
              }
          });
          control.add(quit);
          JMenu help = new JMenu("Help");
          JMenuItem support = new JMenuItem("Support");
          JMenuItem about = new JMenuItem("About");
          about.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent event) {
                  //HERE!
                  aboutWindow.setVisible(true);
              }
          }
          );
          help.add(support);
          help.add(about);
          menubar.add(control);
          menubar.add(windows);
          menubar.add(help);
          controlpanel.setJMenuBar(menubar);
          controlpanel.setVisible(true);
      };
  };
  </code></pre>
  
  <p><code>aboutWindow</code> has been defined in the same class, but not in the <code>main</code> method but in in the <code>about</code> method. How do i address it correctly?</p>
  
  <p>My current solution (not working at all) is in the <code>main</code> method, I have marked it with a comment.</p>