What Is SwingWorker Class?

This section describes what is javax.swing.SwingWorker class - An abstract class introduced in JDK 1.6 as part of the Swing package, that you can extend the SwingWorker class to perform a time intensive computing task in the background to avoid holding the UI component response time for too long.

What Is SwingWorker Class? javax.swing.SwingWorker class is an abstract class introduced in JDK 1.6 as part of the Swing package. You can extend the SwingWorker class to perform a time intensive computing task in the background to avoid holding the UI component response time for too long.

When using the SwingWorker class to perform a background task, there are three threads involved in the execution flow:

To extending the SwingWorker class, you need to consider the following:

Last update: 2014.

Table of Contents

 About This Book

 Introduction of Java Swing Package

 Graphics Environment of the Local System

 JFrame - Main Frame Class

 JLabel - Swing Label Class

 JButton - Swing Button Class

 JRadioButton - Swing Radio Button Class

 JTextField - Swing Text Field Class

 Menu Bar, Menus, Menu Items and Listeners

 Creating Internal Frames inside the Main Frame

 Layout of Components in a Container

 LookAndFeel and UIManager

 Option Dialog Boxes

 JEditorPane - The Editor Pane Class

SwingWorker - The Background Task Worker

What Is SwingWorker Class?

 SwingWorker Example using done() Method

 SwingWorker Example using publish() Method

 SwingWorker Example using "progress" Property

 SwingWorker Example using JProgressBar

 References

 PDF Printing Version