// Creates a timer
that will go off every 1000 ms.
// Each time the timer goes off the total number of
seconds will be
// incremented and the timer text field will be updated to
display the
// total seconds elapsed.
javax.swing.Timer t = new javax.swing.Timer(1000,
new java.awt.event.ActionListener() {
public void
actionPerformed(java.awt.event.ActionEvent evt) {
m_seconds++;
timerEcho.setText( m_seconds + " seconds have passed");
}});
t.start(); // Start the timer