h3.Threaded Programs Code Samples
A thread is a path of execution through a program. Single threaded programs have one path of execution, and multi-threaded programs have two or more paths of execution. For most programs, one thread of execution is all you need, but sometimes it makes sense to use multiple threads in a program to accomplish multiple simultaneous tasks.
* Applet Examples
* Synchronization
h5.Applet Examples
* [SlideShow.java|http://java.sun.com/developer/technicalArticles/Threads/applet/SlideShow.java] downloads three thumbnail paintings by Claude Monet and draws them one-by-one on the applet's panel. For supporting information see [Creating a Threaded Slide Show Applet|http://java.sun.com/developer/technicalArticles/Threads/applet/].
h5.Synchronization
* [Editor.java|http://java.sun.com/developer/technicalArticles/Threads/swing/Editor.java] explains how to use the {{InvokeLater}} method and {{synchronize}} keyword to ensure data integrity when modifying data in Swing components. For supporting information see [Multithreaded Swing Applications|http://java.sun.com/developer/technicalArticles/Threads/swing/].
----
A thread is a path of execution through a program. Single threaded programs have one path of execution, and multi-threaded programs have two or more paths of execution. For most programs, one thread of execution is all you need, but sometimes it makes sense to use multiple threads in a program to accomplish multiple simultaneous tasks.
* Applet Examples
* Synchronization
h5.Applet Examples
* [SlideShow.java|http://java.sun.com/developer/technicalArticles/Threads/applet/SlideShow.java] downloads three thumbnail paintings by Claude Monet and draws them one-by-one on the applet's panel. For supporting information see [Creating a Threaded Slide Show Applet|http://java.sun.com/developer/technicalArticles/Threads/applet/].
h5.Synchronization
* [Editor.java|http://java.sun.com/developer/technicalArticles/Threads/swing/Editor.java] explains how to use the {{InvokeLater}} method and {{synchronize}} keyword to ensure data integrity when modifying data in Swing components. For supporting information see [Multithreaded Swing Applications|http://java.sun.com/developer/technicalArticles/Threads/swing/].
----