I need a way to allow my program to keep running code after this method is called.
Currently, it waits for half an hour, gets the info, stores it to the object WeatherCar
Closing a modal dialog after some delay and updating the display behind a modal dialog are distinct issues.
In this example, a javax.swing.Timer
is used to mark time, and the dialog is closed when a counter reaches zero or the user dismisses it.
A modal dialog only blocks user interaction. Add a modal dialog to this example to see that GUI updates continue in response to the javax.swing.Timer
.
public void run() {
...
f.setVisible(true);
JOptionPane.showMessageDialog(dt, TITLE);
}