title: How to use the variable inside a button phrase outside?
body: <p>I'm trying to build a program which would have a button, a label which gives me how-many times I've clicked the button. But the number is also required in some other places in the program. That's why I'm wondering how to apply the variable for the second time?</p>
  
  <pre><code>    jb.addActionListener(new ActionListener()
              {
  
  
  
                  @Override
                  public void actionPerformed(ActionEvent e) {
                          // TODO Auto-generated method stub\
                          number = 0;
                          number++;
                          .......
                      }
  
            });
       .......
      //String s = "good" + number;
      //jf.setText(s);
      // How to have the variable "number" be still avaliable here?
  
     }// end of some method...
  
  public static void main(String[] args) {
      button2 t = new button2();
  }
  </code></pre>
  
  <p>}</p>