title: Calling actionPerformed() from the other classes
body: <p>I've got three different classes, each one is a separate JFrame with their own GUI and each does different thing. In another class I've got my Keypad class, which all of these classes above contain.</p>
  
  <p>That's part of <code>actionPerformed</code> from my Keypad class:</p>
  
  <pre><code>public void actionPerformed(ActionEvent e) {
          String s = CheckStock.stockNo.getText();
          switch (e.getActionCommand()) {
          case "1":
              CheckStock.stockNo.setText(s + "1");
              break;
          case "2":
              CheckStock.stockNo.setText(s + "2");
              break;
          case "3":
              CheckStock.stockNo.setText(s + "3");
              break;
  </code></pre>
  
  <p>but when is like this I can only use it in my CheckStock class and I want to use this <code>actionPerformed</code> from other classes as well</p>