package com.vci.client.ui.process;
|
|
import java.awt.Color;
|
import java.awt.Dimension;
|
|
import javax.swing.BoxLayout;
|
import javax.swing.JFrame;
|
import javax.swing.JLabel;
|
import javax.swing.JPanel;
|
import javax.swing.JProgressBar;
|
|
public class TestProcessBar {
|
|
/**
|
* @param args
|
*/
|
public static void main(String[] args) {
|
JFrame frame = new JFrame();
|
frame.setSize(new Dimension(600, 500));
|
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
JLabel label = new JLabel("进度:");
|
|
JProgressBar progressBar = new JProgressBar(JProgressBar.HORIZONTAL,0,100);
|
progressBar.setForeground(Color.green);
|
progressBar.setIndeterminate(true);
|
JPanel topPanel = new JPanel();
|
topPanel.setPreferredSize(new Dimension(550, 25));
|
topPanel.setLayout(new BoxLayout(topPanel,BoxLayout.Y_AXIS));
|
topPanel.add(label);
|
topPanel.add(progressBar);
|
frame.add(topPanel);
|
|
frame.setVisible(true);
|
}
|
|
}
|