I want to show a progress bar. I put the code to open the JFrame
containing progress bar at the beginning of the function. But the progress bar opens only after the complete execution of the function
public void function(){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ProgressSearch().setVisible(true);
}
});
instruction 1;
instruction 2;
instruction 3;
instruction 4;
instruction 5;
}
this code above only displays the progress bar after completing the function