import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Font;

public class ShowTime extends JPanel implements TimerListener
{
    private JLabel myLabel;
    
    public ShowTime()
    {
	setLayout(new BorderLayout());
	myLabel = new JLabel("       ", SwingConstants.LEFT);
	myLabel.setFont(new Font("SansSerif",Font.BOLD,24));
	add(myLabel,BorderLayout.CENTER);
    }

    public void timerStarted(Timer timer)
    {
	
    }

    public void timerStopped(Timer timer)
    {
	
    }

    public void timerTicked(Timer timer)
    {
	long timeLeft = timer.timeRemaining();
	long secs = timeLeft / 1000;
	long decs = timeLeft % 1000;
	String s = ""+secs+"."+decs;
	myLabel.setText(s);
	repaint();
    }
}
