hi all
i got problem on JProgress bar. when i click on button progress doesn't show. it display after completing the progress
class A{
//button clic
ProgressBar frame = new ProgressBar();
frame.pack();
frame.setVisible(true);
frame.iterate( );
class ProgressBar extends JFrame //inner class of A
{
JLabel l1;
JProgressBar current;
Thread runner;
int num = 0;
public ProgressBar()
{
super("Maze ProgressBar");
JPanel pane = new JPanel();
pane.setLayout(new GridLayout());
current = new JProgressBar(0, 100);
current.setValue(0);
current.setStringPainted(true);
pane.add(current);
setContentPane(pane);
}
public void iterate()
{
while (num < 1000)
{
current.setValue(num);
try
{
Thread.sleep(500);
}
catch (InterruptedException e)
{
}
num += 90;
}
}
}
pls help me where i m making mistake. thx