天行健
《周易》曰:
天行健,君子以自強不息(乾卦)
地勢坤,君子以厚德載物(坤卦)
導航
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)
主站蜘蛛池模板:
中文字幕乱码免费视频
|
欧美日韩亚洲精品
|
中文字幕手机在线免费看电影
|
国产成人亚洲综合无码
|
国内精品久久久久影院免费
|
亚洲午夜福利717
|
国产免费人成视频尤勿视频
|
亚洲av丰满熟妇在线播放
|
99精品国产免费久久久久久下载
|
国产青草亚洲香蕉精品久久
|
国产在线观看免费视频播放器
|
亚洲精品网站在线观看不卡无广告
|
a级毛片高清免费视频
|
国产亚洲精久久久久久无码77777 国产亚洲精品成人AA片新蒲金
|
一区二区三区免费电影
|
久久久久一级精品亚洲国产成人综合AV区
|
亚洲一区二区在线免费观看
|
亚洲 欧洲 视频 伦小说
|
在线日韩日本国产亚洲
|
亚洲免费在线视频观看
|
亚洲av永久无码精品三区在线4
|
内射无码专区久久亚洲
|
国产免费牲交视频免费播放
|
亚洲中文久久精品无码1
|
国产a v无码专区亚洲av
|
国产成人无码综合亚洲日韩
|
狼友av永久网站免费观看
|
99久久免费看国产精品
|
亚洲伊人久久大香线蕉啊
|
亚洲av日韩av欧v在线天堂
|
免费黄色网址网站
|
99免费精品视频
|
真人无码作爱免费视频
|
国产亚洲国产bv网站在线
|
亚洲成AV人片在线观看无
|
亚洲女人被黑人巨大进入
|
日韩免费三级电影
|
97无码人妻福利免费公开在线视频
|
亚洲av日韩av永久在线观看
|
亚洲一区二区三区91
|
亚洲激情电影在线
|