I´ve got a project and I want to change the value of the progressbar with a call from another class. How could I implement this?
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();
}
}