I am creating a progressBar using JLabel. Problem is when I add this label to my frame and execute some other tasks, my JFrame freezes. Is there any method like invoke and wait for swing to complete its drawing?
private void jButtonOKActionPerformed(java.awt.event.ActionEvent evt) {
JLabel loadingBar = new JLabel("test");
myFrame.add(loadingBar);
doSomeOtherTasks();
}