⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clocklabel.java~3~

📁 用JAVA 编写的宾馆管理系统
💻 JAVA~3~
字号:
package hotel2;import java.awt.*;import javax.swing.JLabel;import java.util.*;import java.text.DateFormat;/** * <p>Title: 客房官理系统</p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2004</p> * <p>Company: </p> * @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;  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -