title: Having a issue using inner class (java)
body: <p>I am trying to use an inner class setup, however I'm having some problems. This is the code I'm trying to use:</p>
  
  <pre><code>public class GUI
  {
     class ButtonHandler implements ActionListener
     {
         public void actionPerformed(ActionEvent e)
         {
           // do something
         }
     }
  
     private static void someMethod()
     {
        JButton button = new JButton( "Foo" );
        button.addActionListener(new ButtonHandler());
     }
  }
  </code></pre>
  
  <p>This is the error message I'm getting (in eclipse):</p>
  
  <pre><code>No enclosing instance of type GUI is accessible. Must qualify the allocation with an enclosing instance of type GUI (e.g. x.new A() where x is an 
   instance of GUI).
  </code></pre>
  
  <p>Please can someone help me out?</p>