title: How to make a non-static global variable in java?
body: <p>I'm making a pong game in java and can't figure out how to pause and have a watch watching if you click the pause button:</p>
  
  <pre><code>fileItem5.addActionListener(new ActionListener() {
  public void actionPerformed(ActionEvent arg0) {
  psd = true;
  </code></pre>
  
  <p>but I can't access it from my other classes. I declared it as</p>
  
  <pre><code>public boolean psd;
  </code></pre>
  
  <p>but when I enter it on my second class  it gives me
  a "variable needs to be static error".</p>