/** Continue to scroll to the left or right for every time step */ public void actionPerformed(ActionEvent e) { if (directedToLeft) { wheeler.scrollLeft(); } else { wheeler.scrollRight(); } }
/** Start the timer when the user presses the mouse. */ public void mousePressed(MouseEvent e) { if (e.getSource().equals(left)) { directedToLeft = true; wheeler.scrollLeft(); timer.start(); } else if (e.getSource().equals(right)) { directedToLeft = false; wheeler.scrollRight(); timer.start(); } else if (e.getSource().equals(down)) { menu.show(down, 5, 5); } }