title: I can't set invisible a JFrame from a actionPerformed declared in an AbstractAction inner class, how to solve?
body: <p>I am developing this <strong>MainWindows</strong> class that extends a <strong>SingleFrameApplication</strong> abstract class that automatically provide a <strong>JFrame</strong></p>
  
  <p>When the <strong>main()</strong> method is executed it check if the user is logged in, if the user is not logged in, first show another <strong>JFrame</strong> windows implemented by the <strong>LoginFrame</strong> class. Here the user insert its username and password and can log in returning to my <strong>MainWindows</strong> (if the login is ok).</p>
  
  <p>At this time this <strong>MainWindows</strong> class contains only a <strong>LogOut</strong> button, and the click event on this button is handled by the <strong>actionPerformed</strong> method definied inside an <strong>AbstractAction</strong> inner class. I want that, when this button is clicked, this <strong>MainWindows</strong> have to be setted as invisible and the <strong>LoginFrame</strong> windows appears in its place.</p>
  
  <p>The problem is that, from here, seems that is impossible to set this <strong>MainWindows</strong> as invisible. Eclipse give me an error on this line:</p>
  
  <pre><code>mainFrame.setVisible(false);
  
  
  
  package com.test.login;
  
  import java.awt.Component;
  import java.awt.Container;
  import java.awt.Dimension;
  import java.awt.event.ActionEvent;
  
  import javax.swing.AbstractAction;
  import javax.swing.Action;
  import javax.swing.JButton;
  import javax.swing.JFrame;
  
  import org.jdesktop.application.SingleFrameApplication;
  
  public class MainWindows extends SingleFrameApplication {
  
      private static final int FIXED_WIDTH = 880;
      private static final Dimension INITAL_SIZE = new Dimension(FIXED_WIDTH, 440);
  
  
      private final Action actionLogOut = new AbstractAction() {
          {
              putValue(Action.NAME, ("LogOut"));
          }
  
          @Override
          public void actionPerformed(ActionEvent e)
          {
              System.out.println("logOutButton clicked !!!");
              String[] args = null;
              launch(LoginFrame.class, args);
              mainFrame.setVisible(false);
          }
      };
  
  
      // First execute the LoginFrame class to open the login windows:
      public static void main(String[] args) {
          System.out.println("Inside: MainWindows() ---&gt; main()");
  
          if(!(args.length &gt; 0 &amp;&amp; args[0].equals("loggedIn"))){
              launch(LoginFrame.class, args);
          }
  
      }
  
      @Override
      protected void startup() {
          // TODO Auto-generated method stub
  
          System.out.println("Inside MainWindows ---&gt; startup()");
  
          JFrame mainFrame = this.getMainFrame();         // main JFrame that represents the Windows
          mainFrame.setTitle("My Appliction MainFrame");
  
          mainFrame.setPreferredSize(INITAL_SIZE);
          mainFrame.setResizable(false);
  
          mainFrame.add(new JButton(actionLogOut));
          //mainFrame.add(new JButton("LogOut"));
  
          show(mainFrame);
  
  
      }
  
  }
  </code></pre>
  
  <p>Someone can help me?</p>
  
  <p>Tnx</p>
  
  <p>Andrea</p>