import java.awt.*; import java.awt.event.*; import java.io.*; public class RunRobot extends Frame implements ActionListener { private SoarRobot robot; public static void main(String[] args) { new RunRobot(); } private Button button1, button2, button3, button4; public RunRobot() { super(); setLayout(new FlowLayout()); setFont(new Font("Serif", Font.BOLD, 18)); button1 = new Button("Run"); button2 = new Button("Stop"); button3 = new Button("Log"); button4 = new Button("Exit"); button1.addActionListener(this); button2.addActionListener(this); button3.addActionListener(this); button4.addActionListener(this); add(button1); add(button2); add(button3); add(button4); setSize(250, 150); setVisible(true); robot = new SoarRobot(); } public void actionPerformed(ActionEvent event) { if (event.getSource() == button1) { //Run robot.startThread(); } else if (event.getSource() == button2) { //Stop robot.quit(); } else if (event.getSource() == button3) { //Log robot.soarSessionEval("watch 5"); } else if (event.getSource() == button4) { //Exit System.exit(0); } } }