August 2004
Intermediate to advanced
480 pages
9h 41m
English
First, the main method calls a static method from the javax.swing.SwingUtilities class called invokeLater(). This method is suited for starting the application, as its purpose is to update the GUI asynchronously on the event dispatching thread.
You can call this method from any thread if you want the event dispatching thread to run some code. If used in this way, it would be invoked like so:
Runnable updateGUI = new Runnable() {
public void run() {
new MyGUI();
}
};
SwingUtilities.invokeLater(updateGUI);
Here, we just create a new object of a type called MyGUI, which probably extends JFrame or holds a JFrame member variable, sets up the properties ...
Read now
Unlock full access