0
我有一个项目,我想用另一个类的调用更改进度条的值。 我怎么能实现这个?在另一个类中更改jprogressbar
static class ButtonActionListener implements ActionListener {
@Override public void actionPerformed(ActionEvent e) {
new Thread(new Runnable()
{
@Override public void run()
{
for (int i = 1; i <= bar.getMaximum(); ++i)
{
final int j = i;
SwingUtilities.invokeLater(new Runnable()
{
@Override public void run() {
bar.setValue(j);
}
});
}
}
}).start();
}
}
请发布您的代码,我们可以帮助您找到错误 – 2014-11-04 11:22:31
其实这是我的代码来改变价值。 现在我想从另一个类中调用这个方法。 – lofoxx 2014-11-04 11:31:27