title: Java: Using an actionlistener to call a function in another class on an object from that class
body: <p>Basically what I want to do is get a start button to initiate a method running in another class and acting on another object.</p>
  
  <p>My code for the listener:</p>
  
  <pre><code>button1a.addActionListener(new ActionListener() {
      public void actionPerformed (ActionEvent event) {
          // Figure out how to make this work
          //sim.runCastleCrash(); 
      }
  } );
  </code></pre>
  
  <p>My code for the other class:</p>
  
  <pre><code>public static void main(String[] args) {
      CastleCrash sim;
      sim = new CastleCrash();
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public void runCastleCrash() {
      System.out.println("Castle Crash is beginning...");
      //Other method parts here to be added
  }
  </code></pre>
  
  <p>I get the feeling this can't be too hard, but I'm missing a piece.</p>