Here runQuery() function executes a query on 4 databases. I want tprogrssBar value should be updated to 50 on screen before it starts running runQuery() function. But screen gets updated after runQuery() is executed.
public void actionPerformed(ActionEvent e) {
String s = e.getActionCommand();
progressBar.setValue(50);
runQuery();
}