import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.text.DateFormat;
import java.util.Calendar;
import java.util.GregorianCalendar;
import javax.swing.JFrame;
import javax.swing.JPanel;
/**
* 时间类 *
*/
public class Clock extends JFrame {
private static final long serialVersionUID = 1L;
//无参数构造器
public Clock() {
ClockPaint cp = new ClockPaint(23, 23, 70);
this.add(cp);
this.setSize(300, 260);
this.setResizable(false);
this.setLocation(260, 120);
this.setTitle("小时钟");
this.setVisible(true);
addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
public static void main(String[] s) {
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余4页未读,立即下载