Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Thinking in Java
Prev Contents / Index Next

Concurrency & Swing

It is easy to forget that you are using threads when you program with Swing. The fact that you don’t have to explicitly create a Thread object means that threading issues can catch you by surprise. Typically, when you write a Swing program, or any GUI application with a windowed display, the majority of the application is event driven, and nothing really happens until the user generates and event by clicking on a GUI component with the mouse, or striking a key.

Just remember that there is a Swing event dispatching thread, which is always there, handling all the Swing events in turn. This needs to be considered if you want to guarantee that your application won’t suffer from deadlocking or race conditions.

This section looks at a couple of issues worth noting when working with threads under Swing.
Thinking in Java
Prev Contents / Index Next


 
 
   Reproduced courtesy of Bruce Eckel, MindView, Inc. Design by Interspire