天行健
《周易》曰:
天行健,君子以自強不息(乾卦)
地勢坤,君子以厚德載物(坤卦)
導航
BlogJava
首頁
新隨筆
聯系
聚合
管理
統計
隨筆 - 119
文章 - 4
評論 - 92
引用 - 0
公告
對家人好點,對朋友好點,對自己好點
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)
系統設計(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)
技術文章
(rss)
文章檔案
2011年6月 (1)
2006年9月 (1)
2006年6月 (1)
2006年4月 (1)
搜索
最新評論
1.?re: 無法使用此產品的安裝源,請確認安裝源存在,并且您可以訪問它
兩種方法都用了,都不行呀
--龍
2.?re: 系統啟動時出現錯誤:應用程序-特定 權限設置未將 COM 服務器應用程序(CLSID 為 {BA126AD1-2166-11D1-B1D0-00805FC1270E})的 本地 激活 權限授予用戶 NT AUTHORITY\NETWORK SERVICE 的解決.
DCOM
--dacan
3.?re: 關于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[轉][未登錄]
多謝
--zw
5.?re: 解決JS頁面跳轉ie,firefox,opera不兼容問題[未登錄]
在opera還是不能跳轉
--vincent
閱讀排行榜
1.?Hibernate SQL方言 (hibernate.dialect)(49472)
2.?幾種js實現的動態多文件上傳(32295)
3.?java創建文件夾,文件;刪除文件夾,文件(30133)
4.?無法使用此產品的安裝源,請確認安裝源存在,并且您可以訪問它(30073)
5.?js截取字符串的方法(19757)
評論排行榜
1.?[linux]警告:檢測到時鐘錯誤。您的創建可能是不完整的。(13)
2.?無法使用此產品的安裝源,請確認安裝源存在,并且您可以訪問它(13)
3.?幾種js實現的動態多文件上傳(12)
4.?Cannot find bean under name org.apache.struts.taglib.html.BEAN[轉](7)
5.?在用MyEclipse發布應用,構建路徑的問題(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)
閱讀(3715)
評論(1)
編輯
收藏
所屬分類:
JAVA文章
Comments
#
re: 一個JProgressBar的簡單例子
老歐
謝謝,正需要
Posted @ 2008-11-27 20:47
回復
更多評論
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
項目中成功的運用proxool連接池
在繼承中的成員變量好像不會向下轉型的
一個JProgressBar的簡單例子
Powered by:
BlogJava
Copyright © 重歸本壘(Bing)
主站蜘蛛池模板:
免费亚洲视频在线观看
|
香蕉视频在线免费看
|
亚洲精品在线免费看
|
国产AV无码专区亚洲Av
|
一级美国片免费看
|
精品亚洲一区二区三区在线观看
|
亚洲国产精品SSS在线观看AV
|
一个人看的免费高清视频日本
|
国产精品成人无码免费
|
亚洲精品色在线网站
|
国产午夜影视大全免费观看
|
色婷婷六月亚洲综合香蕉
|
国产精品黄页在线播放免费
|
美女被免费网站视频在线
|
亚洲黄黄黄网站在线观看
|
a免费毛片在线播放
|
一本色道久久综合亚洲精品
|
99久久国产精品免费一区二区
|
亚洲国产一区二区a毛片
|
国产一卡二卡四卡免费
|
亚洲国产精品嫩草影院
|
MM131亚洲国产美女久久
|
美女视频黄a视频全免费网站色窝 美女被cao网站免费看在线看
|
亚洲成aⅴ人在线观看
|
四虎国产精品永久免费网址
|
午夜免费福利在线观看
|
亚洲国产成人久久精品软件
|
最近免费中文字幕4
|
亚洲欧洲日韩综合
|
a毛片免费全部播放完整成
|
亚洲精品无码专区在线在线播放
|
国产乱子伦精品免费视频
|
亚洲日本一区二区三区在线
|
免费无码又爽又刺激高潮软件
|
亚洲国产成人片在线观看
|
一区二区免费国产在线观看
|
在线日韩日本国产亚洲
|
国产在线精品免费aaa片
|
亚洲欧洲国产视频
|
免费一本色道久久一区
|
国产精品亚洲综合久久
|