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
Applet Examples
- 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.
Synchronization
- 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.