我正在迭代Excel文件的行。我想每次到达1500的倍数时更新jLabel,但文本没有更新。当它离开循环时它会更新。有没有更好的方法呢?感谢
while (iteratorold.hasNext()){
Row rowold =iteratorold.next();
int qw = rowold.getRowNum();
if (qw%1500==0){
Thread.sleep(500);
jLabel6.setText("Processing record "+qw+" out of"+ total+ " "+ "(" + (qw/total)*100+"%");
jLabel6.paintImmediately(jLabel6.getVisibleRect());
// Thread.sleep(10000);
// jProgressBar1.setValue((qw/total)*100);
}
Cell cellold = rowold.getCell(4);
stringSet.add(cellold.toString());
}