title: Accessing Variable within JButton ActionListener
body: <p>This seems like a very simple problem, but I'm having a lot of trouble figuring out how to deal with it.</p>
  
  <p>Sample Scenario:</p>
  
  <pre><code>    final int number = 0;
  
      JFrame frame = new JFrame();
      frame.setVisible(true); 
      frame.setDefaultCloseOperation(EXIT_ON_CLOSE); 
      frame.setSize(400, 400); 
  
      final JTextArea text = new JTextArea();
      frame.add(text, BorderLayout.NORTH);
  
      JButton button = new JButton(number + ""); 
      button.addActionListener(new ActionListener() { 
      public void actionPerformed(ActionEvent arg0) { 
          number++; // Error is on this line
          text.setText(number + "");
      }});
      frame.add(button, BorderLayout.SOUTH);
  </code></pre>
  
  <p>I really have no idea where to go.</p>