宾馆管理系统实例 用Java与sql server 2000来创建一个宾馆管理系统

源代码在线查看: clocklabel.java~2~

软件大小: 288 K
上传用户: fq335288450
关键词: server Java 2000 sql
下载地址: 免注册下载 普通下载 VIP

相关代码

				package hotel;
				
				import java.awt.*;
				import javax.swing.JLabel;
				import java.util.*;
				import java.text.*;
				/**
				 * Title: 宾馆官理系统
				 * Description: 第七章实例
				 * Copyright: Copyright (c) 2006
				 * Company: 
				 * @author 苏年乐
				 * @version 1.0
				 */
				
				/**
				 * 计时
				 */
				public class Clocklabel
				    extends JLabel
				    implements Runnable {
				  private Thread clockthread = null;
				  public Clocklabel() {
				    if (clockthread == null) {
				      clockthread = new Thread(this, "clock");
				      clockthread.start();
				    }
				  }
				
				  public void run() {
				    while (true) {
				      Calendar cal = Calendar.getInstance();
				      Date date = cal.getTime();
				      DateFormat dateformatter = DateFormat.getTimeInstance();
				      this.setText(dateformatter.format(date));
				      try {
				        Thread.sleep(1000);
				      }
				      catch (Exception e) {}
				    }
				
				  }
				
				  public Thread getClockthread() {
				    return clockthread;
				  }
				
				}
							

相关资源