import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.event.*;public class ExampleBar extends JFrame implements ActionListener,ChangeListener
{
private JProgressBar jpb;
private JButton jbutton;
private JLabel label1;

public ExampleBar(){
super("进度条演示举例:");
this.getContentPane().setLayout(new FlowLayout());
//创建进度条
jpb = new JProgressBar();
jbutton = new JButton("观看演示");
jbutton.addActionListener(this);
this.getContentPane().add(jbutton);
//设置进度条的前景色为红色
jpb.setForeground(Color.red);
this.getContentPane().add(jpb);
//给进度条注册事件监听器
jpb.addChangeListener(this);
label1 = new JLabel();
this.getContentPane().add(label1);
this.setSize(300,300);
this.setVisible(true);
}

public static void main(String[] args)
{
ExampleBar ex = new ExampleBar();
}

public void stateChanged(ChangeEvent e){
label1.setText("当前进度为:"+jpb.getValue());
}

public void actionPerformed(ActionEvent e){
//当前进度条的值不等于其最大值时
if (jpb.getValue()!=jpb.getMaximum())
jpb.setValue(jpb.getValue()+10);
else
jpb.setValue(jpb.getMinimum());
}
}怎么把他弄成一按button键进程条就自动慢慢变满?