import javax.swing.*; import java.awt.event.*; public class TimerExample extends JApplet implements ActionListener { Timer theTimer; int times_timer_called; public void init() { times_timer_called = 0; theTimer = new Timer( 250, this ); theTimer.start(); } public void actionPerformed( ActionEvent event ) { print_timer_counts(); } public void print_timer_counts() { ++times_timer_called; System.out.println( times_timer_called ); if ( times_timer_called == 10 ) { theTimer.setDelay( 1000 ); } } }