/* * Links the JButtons and the graphic sequences to display the lights * */ if(event.getSource() == GO) //display green if GO is clicked { clickGO = true; carX -=15; repaint(); } if (event.getSource() == WAIT) //display yellow if WAIT is clicked { clickWAIT = true; repaint(); } if (event.getSource() == STOP) //display red if STOP is clicked { clickSTOP = true; repaint(); }