Hey guys,
i have a simple question.
i have a JLabel jlbl_status in which i want so show the status of the current process.
if i set the text with the setText() method the text is not displayed in that moment.
It will be displayed after the whole action...
for example:
i have a JButton which trigges the following
btw. i also have the same problem with my JProgressBar ;-)Code:log.info("recalculate Values"); RecalculateTableValuesJob job; try { job = new RecalculateTableValuesJob(); }catch(Exception e){ log.error("Cant start the recalc. job"); e.printStackTrace(); return; } setStatus("Calculation..."); setProgress(0); job.start(); while(job.isRunning){ try{Thread.sleep(1000); }catch(Exception e){} int p = (int)(100*xlsData.getRowCount()/job.currentIndex); setProgress(p); } setProgress(100); log.info("recalculate Values Done");
my setStatus looks like
i have tried also withCode:public void setStatus(String text) { log.debug("Status: "+text); jlbl_status.setText(text); }
jlbl_status.invalidate();
jlbl_status.revalidate();
jlbl_status.repaint();
so PLEASE!! help me... why doesnt my JLabel repaint synchronously?




Reply With Quote