Java ProgressBar gui构建器netbeans

时间:2011-02-10 18:06:06

标签: java netbeans progress-bar

我想从netbeans GUI builder中使用ProgressBar 任何一个例子将不胜感激 谢谢

2 个答案:

答案 0 :(得分:0)

Sun / Orcale的Java教程始终是寻找此类信息的良好开端:

http://download.oracle.com/javase/tutorial/uiswing/components/progress.html

答案 1 :(得分:0)

这是一个简单的ProgressBar演示程序

package test;

import java.awt.BorderLayout;
import javax.swing.JFrame;
import javax.swing.JProgressBar;

public class ProgressBarDemo {

    JFrame frame;
    JProgressBar progressBar;

    public ProgressBarDemo() {
        frame = new JFrame("ProgressBarDemo");
        frame.setSize(400, 400);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        progressBar = new JProgressBar();
        progressBar.setValue(40);
        frame.getContentPane().add(progressBar,BorderLayout.SOUTH);
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        new ProgressBarDemo();
    }

}