title: Java: How to return values from mouseEvent/keyboardEvent methods?
body: <p>I have a mouse event method that stores the amount of clicks as an integer called x. I want to use my x variable data for another class or method, but the compilation will fail if I try to return data to make it a class variable. What should I do?</p>
  
  <pre><code>public void mouseClicked(MouseEvent e) {
     int x = e.getClickCount();
  }
  </code></pre>