I have a jFrame, that has a jButton on it along with a jLabel that I expect to be updated on the jFrame when I push
the button. So, in the action listener action performed method I change the value to be displayed on the jLabel:
// Change the test indicator, before the test is done, indicating test in progress
jlblTestResultDisp.setText("<html><font color = black> TESTING</font></html>");
Then, I call the repaint() method on both the jLabel and the jFrame it is part of, inside the same action listener action performed method:
this.validate(); // where 'this' refers to the jFrame
Nothing happens at this point!
Then from inside the button action listener I call a method that will run a script that it will take several seconds
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec(testScriptToRun);
int exitVal = proc.waitFor();
When the exitVal comes back from the process, which several seconds later that's only when the jFrame refreshes. until then the jFrame is just 'hanging in there', after pushing the test button nothing shows up
on jFrame as far as changes.
Question: How do I make the JFrame refresh right after pushing the 'Start Standard Test' button and BEFORE the script is run from the action performed and the exitVal comes back ? Basically I want to show a message on the jLabel , while waiting for the script to finish running and proc.waitFor() method returns the value to let the action performed method return.
Thank you for your help.