In the code below I want to do something after invokeLater is done. 1) I can not use invokeAndWait due to setModel being called by dispatcher. 2) I can not change the value of a final variable inside thread! then how can I wait for involeLater to be done first?
boolean isDone=false;
SwingUtilities.invokeLater(new Runnable(){public void run(){
setModel(new DefaultTableModel(oRecordTable, sIP_TABLE_COL_NAMES_LIST));
isDone = true; // CAN NOT BE CHANGED HERE, AS HAS TO BE FINAL
}});
while (!idDone){
//wait
}
// do something here after the invokeLater is done