Code:
import javax.swing.*;
import java.util.*;
public class Clock 
{
	JFrame frame=new JFrame();
	frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	frame.setTitle("Clock");
	frame.setSize(550,220);
	JLabel display=new JLabel();
	display.setFont(new Font(Font.BOLD,38));
	frame.getContentPane().add(display);
	int last=-1;
	do
	{
		Date current=new Date();
		int sec=current.getSeconds();
		if(last!=sec)
		{
			display.setText(current.toString());
			last=sec;
		}
	}while(true);
}
}
Why does it not work