import javax.swing.*;
import java.awt.*;
class progDemo extends JFrame
{
JProgressBar jpb = new JProgressBar(0,100);
progDemo()
{
setVisible(true);
setSize(400,400);
setLayout(new FlowLayout());
add(jpb);
Thread t = new Thread(new Runnable(){
public void run()
{
try
{
for(int i=0;i<=100;i++)
{
jpb.setValue(i);
Thread.sleep(100);
}
}
catch(Exception e){System.out.println(e);}
}
});
t.start();
}
public static void main(String s[])
{
new progDemo();
}
}
import java.awt.*;
class progDemo extends JFrame
{
JProgressBar jpb = new JProgressBar(0,100);
progDemo()
{
setVisible(true);
setSize(400,400);
setLayout(new FlowLayout());
add(jpb);
Thread t = new Thread(new Runnable(){
public void run()
{
try
{
for(int i=0;i<=100;i++)
{
jpb.setValue(i);
Thread.sleep(100);
}
}
catch(Exception e){System.out.println(e);}
}
});
t.start();
}
public static void main(String s[])
{
new progDemo();
}
}
0 comments:
Post a Comment