1 package be
.nikiroo
.utils
.ui
.test
;
3 import java
.awt
.BorderLayout
;
4 import java
.awt
.event
.ActionEvent
;
5 import java
.awt
.event
.ActionListener
;
7 import javax
.swing
.JButton
;
8 import javax
.swing
.JFrame
;
10 import be
.nikiroo
.utils
.Progress
;
11 import be
.nikiroo
.utils
.ui
.ProgressBar
;
13 public class ProgressBarManualTest
extends JFrame
{
14 private static final long serialVersionUID
= 1L;
17 public ProgressBarManualTest() {
18 final ProgressBar bar
= new ProgressBar();
19 final Progress pg
= new Progress("name");
20 final Progress pg2
= new Progress("second level", 0, 2);
21 final Progress pg3
= new Progress("third level");
23 setLayout(new BorderLayout());
24 this.add(bar
, BorderLayout
.SOUTH
);
26 final JButton b
= new JButton("Set pg to 10%");
27 b
.addActionListener(new ActionListener() {
29 public void actionPerformed(ActionEvent e
) {
34 b
.setText("Set pg to 20%");
38 b
.setText("Add pg2 (0-2)");
41 pg
.addProgress(pg2
, 80);
43 b
.setText("Add pg3 (0-100)");
46 pg2
.addProgress(pg3
, 2);
48 b
.setText("Set pg3 to 10%");
52 b
.setText("Set pg3 to 20%");
56 b
.setText("Set pg3 to 60%");
60 b
.setText("Set pg3 to 100%");
71 this.add(b
, BorderLayout
.CENTER
);
74 setDefaultCloseOperation(JFrame
.EXIT_ON_CLOSE
);
79 public static void main(String
[] args
) {
80 new ProgressBarManualTest().setVisible(true);