FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Java-Lab-File-Programs/Q21_Progress_bar.java at main · sagargoswami2001/Java-Lab-File-Programs · GitHub
sagargoswami2001
/
Java-Lab-File-Programs
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
7
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java-Lab-File-Programs
/
Q21_Progress_bar.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
37 lines (33 loc) · 871 Bytes
Breadcrumbs
Java-Lab-File-Programs
/
Q21_Progress_bar.java
Copy path
File metadata and controls
37 lines (33 loc) · 871 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//Q21. WAP to show working of a progress bar.
package
JAVA_Lab_File
;
import
javax
.
swing
.*;
public
class
Q21_Progress_bar
extends
JFrame
{
static
JFrame
f
;
static
JProgressBar
b
;
public
static
void
main
(
String
[]
args
) {
f
=
new
JFrame
(
"Zaphkiel's Progress Bar"
);
b
=
new
JProgressBar
(
0
,
2000
);
b
.
setBounds
(
40
,
40
,
160
,
30
);
b
.
setValue
(
0
);
b
.
setStringPainted
(
true
);
f
.
add
(
b
);
f
.
setSize
(
250
,
150
);
f
.
setLayout
(
null
);
f
.
setVisible
(
true
);
f
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
fill
();
}
public
static
void
fill
()
{
int
i
=
0
;
try
{
while
(
i
<=
100
) {
b
.
setValue
(
i
+
10
);
Thread
.
sleep
(
1000
);
i
+=
20
;
}
}
catch
(
Exception
e
) {
}
}
}
Back
|
FazBrowse Home
|
New Git URL