title: Making a method trigger another method in a Java GUI
body: <p>Consider the following code.</p>
  
  <pre><code>import edu.cmu.ri.createlab.terk.robot.finch.Finch;
  import javax.swing.JFrame;
  import java.awt.*;
  import java.awt.event.ActionEvent;
  import java.awt.event.ActionListener;
  import javax.swing.*;
  
  public class RobotControl extends JFrame { 
      public static void main (String args[])  {
  
      RobotControl GUI = new RobotControl(); //GUI is the name of my object.
      GUI.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
      GUI.setSize(300,300);
      GUI.setVisible(true);
      GUI.setTitle("RobotControl");
  }
  
  
      private JButton foward;
  
  
  
      public RobotControl() { //constructor
      setLayout (new FlowLayout());
  
      foward = new JButton("foward");
      add(foward);
  
      ActionListener e = new event();
      foward.addActionListener(e);
      }
               public class event implements ActionListener {
                         public void actionPerformed1(ActionEvent e){
  
  
      }
  
      @Override
      public void actionPerformed(ActionEvent arg0) {
          // TODO Auto-generated method stub
  
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Now consider the following code that would make my finch robot move foward for 10 seconds.</p>
  
  <pre><code>            Finch myf = new Finch();
              myf.setWheelVelocities(255, 255, 10000);
  </code></pre>
  
  <p>Now, my question is, would it be possible to execute the second piece of code as a result of clicking the foward button created on the GUI, from the first piece of code? If so how would i go about it. I have tried putting the finch code into the actionListener class but nothing happens. where am i going wrong. I need advice.</p>