天行健
《周易》曰:
天行健,君子以自強(qiáng)不息(乾卦)
地勢坤,君子以厚德載物(坤卦)
導(dǎo)航
BlogJava
首頁
新隨筆
聯(lián)系
聚合
管理
統(tǒng)計(jì)
隨筆 - 119
文章 - 4
評論 - 92
引用 - 0
公告
對家人好點(diǎn),對朋友好點(diǎn),對自己好點(diǎn)
bnlovebn@21cn.com
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(5)
給我留言
查看公開留言
查看私人留言
隨筆分類
AJAX(2)
(rss)
DataBase(18)
(rss)
Hibernate(6)
(rss)
JAVA (24)
(rss)
JS(11)
(rss)
JSP(18)
(rss)
linux(5)
(rss)
SOA(1)
(rss)
Spring(7)
(rss)
Struts(6)
(rss)
webserver(2)
(rss)
WML(1)
(rss)
其它(25)
(rss)
系統(tǒng)設(shè)計(jì)(5)
(rss)
隨筆檔案
2011年6月 (3)
2010年4月 (1)
2008年12月 (1)
2008年9月 (2)
2008年6月 (4)
2008年5月 (8)
2008年4月 (3)
2008年3月 (5)
2007年11月 (5)
2007年10月 (2)
2007年9月 (1)
2007年7月 (15)
2007年6月 (3)
2007年5月 (8)
2007年4月 (3)
2007年3月 (1)
2007年2月 (6)
2007年1月 (5)
2006年12月 (15)
2006年11月 (5)
2006年10月 (3)
2006年9月 (3)
2006年7月 (2)
2006年6月 (14)
2006年4月 (1)
文章分類
JAVA文章(3)
(rss)
JSP文章
(rss)
其它(1)
(rss)
技術(shù)文章
(rss)
文章檔案
2011年6月 (1)
2006年9月 (1)
2006年6月 (1)
2006年4月 (1)
搜索
最新評論
1.?re: 無法使用此產(chǎn)品的安裝源,請確認(rèn)安裝源存在,并且您可以訪問它
兩種方法都用了,都不行呀
--龍
2.?re: 系統(tǒng)啟動時出現(xiàn)錯誤:應(yīng)用程序-特定 權(quán)限設(shè)置未將 COM 服務(wù)器應(yīng)用程序(CLSID 為 {BA126AD1-2166-11D1-B1D0-00805FC1270E})的 本地 激活 權(quán)限授予用戶 NT AUTHORITY\NETWORK SERVICE 的解決.
DCOM
--dacan
3.?re: 關(guān)于Myeclipse configuration center中software中的personal sites中添加的插件無法刪除的解決
刪除 add site history :
D:\Genuitec是安裝目錄
D:\Genuitec\Common\configuration\bookmark.properties
--g_man1990
4.?re: Cannot find bean under name org.apache.struts.taglib.html.BEAN[轉(zhuǎn)][未登錄]
多謝
--zw
5.?re: 解決JS頁面跳轉(zhuǎn)ie,firefox,opera不兼容問題[未登錄]
在opera還是不能跳轉(zhuǎn)
--vincent
閱讀排行榜
1.?Hibernate SQL方言 (hibernate.dialect)(49478)
2.?幾種js實(shí)現(xiàn)的動態(tài)多文件上傳(32324)
3.?java創(chuàng)建文件夾,文件;刪除文件夾,文件(30143)
4.?無法使用此產(chǎn)品的安裝源,請確認(rèn)安裝源存在,并且您可以訪問它(30110)
5.?js截取字符串的方法(19764)
評論排行榜
1.?[linux]警告:檢測到時鐘錯誤。您的創(chuàng)建可能是不完整的。(13)
2.?無法使用此產(chǎn)品的安裝源,請確認(rèn)安裝源存在,并且您可以訪問它(13)
3.?幾種js實(shí)現(xiàn)的動態(tài)多文件上傳(12)
4.?Cannot find bean under name org.apache.struts.taglib.html.BEAN[轉(zhuǎn)](7)
5.?在用MyEclipse發(fā)布應(yīng)用,構(gòu)建路徑的問題(7)
一個JProgressBar的簡單例子
?
?
?1
import
?javax.swing.
*
;
?2
import
?java.awt.
*
;
?3
import
?java.awt.event.
*
;
?4
import
?javax.swing.event.
*
;
?5
import
?javax.swing.border.
*
;
?6
?7
?8
public
?
class
?JProgressEx?
extends
?JApplet
{
?9
?
private
?
int
?min
=
0
,max
=
100
;
10
??
private
?JProgressBar?pb?
=
?
new
?JProgressBar();
11
?
private
?Timer?t;
12
??
private
?
int
?i;
13
???JPanel?panel?
=
?
new
?JPanel();
14
??
public
?JProgressEx()
{
15
??}
16
??
public
?
synchronized
?
void
?setValue()
{
17
???i
=
0
;
18
??}
19
??
public
?
synchronized
?
int
?getValue()
{
20
???
return
?i;
21
??}
22
??
public
?
synchronized
?
void
?addValue()
{
23
???i
++
;
24
??}
25
??
public
?
void
?setMin()
{
26
???
this
.min?
=
?min;
27
??}
28
??
public
?
int
?getMin()
{
29
???
return
?min;
30
??}
31
??
public
?
void
?setMax()
{
32
???
this
.max?
=
?max;
33
??}
34
??
public
?
int
?getMax()
{
35
???
return
?max;
36
??}
37
38
?
public
?
void
?init()?
{
39
????Container?cp?
=
?getContentPane();
40
????pb.setMinimum(min);
41
????pb.setMaximum(max);
42
????pb.setBackground?(Color.white);
43
????pb.setForeground?(Color.red);
44
????pb.setStringPainted(
true
)?;
45
????cp.add(panel.add(pb),BorderLayout.PAGE_START);
46
??}
47
??
public
?
void
?start()
{
48
???t?
=
?
new
?Timer(
100
,?
new
?ActionListener()?
{
49
??????
public
?
void
?actionPerformed(ActionEvent?evt)?
{
50
????????
if
(getValue()
<
getMax())
{
51
??????????addValue();
52
??????????pb.setValue(getValue());
53
????????}
else
{
54
??????????setValue();
55
??????????t.stop();
56
????????}
57
????}
58
????}
);
59
??t.start();
60
??}
61
??
public
?
static
?
void
?main(String[]?args)?
{
62
??
final
?JProgressEx?pg?
=
?
new
??JProgressEx();
63
????JFrame?frame?
=
?
new
?JFrame(
"
JProgressEx
"
);
64
????frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
65
????frame.getContentPane().add(pg);
66
????frame.setSize(
300
,?
200
);
67
????pg.init();
68
????frame.setVisible(
true
);
69
????pg.start();
70
??}
71
}
72
?
?7
?8
public
?
class
?JProgressEx?
extends
?JApplet
{
?9
?
private
?
int
?min
=
0
,max
=
100
;
10
??
private
?JProgressBar?pb?
=
?
new
?JProgressBar();
11
?
private
?Timer?t;
12
??
private
?
int
?i;
13
???JPanel?panel?
=
?
new
?JPanel();
14
??
public
?JProgressEx()
{
15
??}
16
??
public
?
synchronized
?
void
?setValue()
{
17
???i
=
0
;
18
??}
19
??
public
?
synchronized
?
int
?getValue()
{
20
???
return
?i;
21
??}
22
??
public
?
synchronized
?
void
?addValue()
{
23
???i
++
;
24
??}
25
??
public
?
void
?setMin()
{
26
???
this
.min?
=
?min;
27
??}
28
??
public
?
int
?getMin()
{
29
???
return
?min;
30
??}
31
??
public
?
void
?setMax()
{
32
???
this
.max?
=
?max;
33
??}
34
??
public
?
int
?getMax()
{
35
???
return
?max;
36
??}
37
38
?
public
?
void
?init()?
{
39
????Container?cp?
=
?getContentPane();
40
????pb.setMinimum(min);
41
????pb.setMaximum(max);
42
????pb.setBackground?(Color.white);
43
????pb.setForeground?(Color.red);
44
????pb.setStringPainted(
true
)?;
45
????cp.add(panel.add(pb),BorderLayout.PAGE_START);
46
??}
47
??
public
?
void
?start()
{
48
???t?
=
?
new
?Timer(
100
,?
new
?ActionListener()?
{
49
??????
public
?
void
?actionPerformed(ActionEvent?evt)?
{
50
????????
if
(getValue()
<
getMax())
{
51
??????????addValue();
52
??????????pb.setValue(getValue());
53
????????}
else
{
54
??????????setValue();
55
??????????t.stop();
56
????????}
57
????}
58
????}
);
59
??t.start();
60
??}
61
??
public
?
static
?
void
?main(String[]?args)?
{
62
??
final
?JProgressEx?pg?
=
?
new
??JProgressEx();
63
????JFrame?frame?
=
?
new
?JFrame(
"
JProgressEx
"
);
64
????frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
65
????frame.getContentPane().add(pg);
66
????frame.setSize(
300
,?
200
);
67
????pg.init();
68
????frame.setVisible(
true
);
69
????pg.start();
70
??}
71
}
72
?
posted on 2006-04-10 17:25
重歸本壘(Bing)
閱讀(3719)
評論(1)
編輯
收藏
所屬分類:
JAVA文章
Comments
#
re: 一個JProgressBar的簡單例子
老歐
謝謝,正需要
Posted @ 2008-11-27 20:47
回復(fù)
更多評論
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發(fā)表評論。
網(wǎng)站導(dǎo)航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關(guān)文章:
項(xiàng)目中成功的運(yùn)用proxool連接池
在繼承中的成員變量好像不會向下轉(zhuǎn)型的
一個JProgressBar的簡單例子
Powered by:
BlogJava
Copyright © 重歸本壘(Bing)
主站蜘蛛池模板:
亚洲av日韩综合一区久热
|
国产专区一va亚洲v天堂
|
无限动漫网在线观看免费
|
免费国产叼嘿视频大全网站
|
丁香亚洲综合五月天婷婷
|
亚洲精品无码专区久久
|
国产在线观看免费av站
|
女人18毛片水最多免费观看
|
亚洲人成人伊人成综合网无码
|
又粗又大又猛又爽免费视频
|
久久av无码专区亚洲av桃花岛
|
亚洲乱妇老熟女爽到高潮的片
|
67194成是人免费无码
|
久久夜色精品国产嚕嚕亚洲av
|
四虎影视无码永久免费
|
亚洲久本草在线中文字幕
|
亚洲成人免费电影
|
亚洲国产成人一区二区三区
|
a级毛片免费播放
|
亚洲黄色在线视频
|
国产日韩AV免费无码一区二区
|
亚洲女同成av人片在线观看
|
久艹视频在线免费观看
|
亚洲一区二区三区香蕉
|
久久久久久成人毛片免费看
|
亚洲免费在线视频观看
|
国产自产拍精品视频免费看
|
亚洲熟妇少妇任你躁在线观看
|
国产在线不卡免费播放
|
中国内地毛片免费高清
|
亚洲国产av一区二区三区丶
|
免费高清在线爱做视频
|
亚洲人片在线观看天堂无码
|
亚洲精品国产日韩无码AV永久免费网
|
国产自国产自愉自愉免费24区
|
亚洲日韩中文字幕
|
亚洲日韩在线观看免费视频
|
91精品国产免费久久国语蜜臀
|
亚洲日韩在线中文字幕综合
|
国产产在线精品亚洲AAVV
|
亚洲AV永久无码区成人网站
|