A Recap on the Event Dispatch Thread

Before we go any further, we should recap the Event Dispatch Thread a little. As you know, the Event Dispatch Thread processes events from repaints to mouse events to action events, as we have seen in this chapter. Whenever a method is invoked as a result of one of these events, such as actionPerformed, mousePressed, paint, keyReleased, or windowClosing, all of which we have seen in previous chapters of the book, they are all running in the Event Dispatch Thread. As we mentioned in Chapter 9, you are able to run your own code from another thread using the SwingUtilities static methods invokeAndWait and invokeLater.



Java 1.4 Game Programming
Java 1.4 Game Programming (Wordware Game and Graphics Library)
ISBN: 1556229631
EAN: 2147483647
Year: 2003
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net