package com.kaylves;

成都創(chuàng)新互聯(lián)公司長期為成百上千客戶提供的網(wǎng)站建設(shè)服務(wù),團隊從業(yè)經(jīng)驗10年,關(guān)注不同地域、不同群體,并針對不同對象提供差異化的產(chǎn)品和服務(wù);打造開放共贏平臺,與合作伙伴共同營造健康的互聯(lián)網(wǎng)生態(tài)環(huán)境。為遼寧企業(yè)提供專業(yè)的網(wǎng)站建設(shè)、網(wǎng)站制作,遼寧網(wǎng)站改版等技術(shù)服務(wù)。擁有10余年豐富建站經(jīng)驗和眾多成功案例,為您定制開發(fā)。
import java.text.SimpleDateFormat;
import java.util.Date;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Clock {
public static void main(String[] args) throws InterruptedException {
JFrame f = new JFrame();
Timer timer = new Timer();
Thread th=new Thread(timer);
th.start();
JLabel time = new JLabel();
f.add(time);
f.setVisible(true);
f.pack();
while(true){
time.setText(timer.getCurrentTime());
}
}
}
class Timer implements Runnable {
private String currentTime;
public String getCurrentTime() {
Date d = new Date();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
currentTime = sdf.format(d);
return currentTime;
}
public void run() {
try {
Thread.sleep(1000);
getCurrentTime();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
完成給核液汪改仔分埋哪
網(wǎng)頁標(biāo)題:java全屏?xí)r鐘代碼 java圖形時鐘
文章分享:http://chinadenli.net/article29/dsphijh.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)、標(biāo)簽優(yōu)化、App設(shè)計、網(wǎng)站內(nèi)鏈、服務(wù)器托管、面包屑導(dǎo)航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)