Beruflich Dokumente
Kultur Dokumente
About Us
Request a Tutorial
Contact Us
22/09/16, 01)37
Advertising
Privacy Policy
Home
SQL
Java Swing
GETTING
STARTED
Introduction to
Java Swing
PL/SQL
JSP
Data Warehouse
Data Mining
PHP
Perl
JavaScript
Python
Developing
the First
Swing
Application
LAYOUT
MANAGER
Java Swing
Layouts
BorderLayout
FlowLayout
GridLayout
GridBagLayou
t
CardLayout
BASIC
COMPONENTS
JButton
JToggleButton
JCheckBox
JRadioButton
http://www.zentut.com/java-swing/jprogressbar/
Pgina 1 de 3
JLabel
JTextField
JTextArea
22/09/16, 01)37
Constructors
Meaning
public JProgressBar()
public
JEditorPane
JSpinner
model)
JComboBox
bySwingConstants.VERTICAL or SwingConstants.H
JList
JPasswordFie
ld
max)
JScrollBar
JProgressBar
JSlider
JAVA SWING
DIALOGS
Java Swing
Dialog
JColorChoose
r
JFileChooser
JOptionPane
Creating
Login Dialog
Creating
Menu
Popup Menu
ToolBar
Displaying
Data using
JTable
1
2
3
4
5
6
7
8
9
10
11
12
13
package jprogressbardemo;
import java.awt.*;
import javax.swing.*;
public class Main {
public static void main(String
String[] args) {
final int MAX = 100;
final JFrame frame = new JFrame("JProgress Demo")
http://www.zentut.com/java-swing/jprogressbar/
Pgina 2 de 3
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42 }
22/09/16, 01)37
pb.setMinimum(0);
pb.setMaximum(MAX);
pb.setStringPainted(true
true);
// update progressbar
for (int
int i = 0; i <= MAX; i++) {
final int currentValue = i;
try {
SwingUtilities.invokeLater(new
new Runnable()
public void run() {
pb.setValue(currentValue);
}
});
java.lang.Thread.sleep(100);
} catch (InterruptedException e) {
JOptionPane.showMessageDialog(frame, e.getMessage
}
}
}
Previous Tutorial:
Next Tutorial:
http://www.zentut.com/java-swing/jprogressbar/
Pgina 3 de 3