new Thread(){
public void run(){
String status="";
int num=100000000;
for(int i=0;i < num ;i++){
DecimalFormat df=new DecimalFormat("##.##");
status=df.format((double)i/num*100);//percentage
if(i%1000==0){
SwingUtilities.invokeLater(new Runnable(){
public void run(){
frame.setTitle(status+"%");
}
});
}
}
}
}.start();
沒有留言:
張貼留言