Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

SwingWorker Class Reference

An abstract class that you subclass to perform GUI-related work in a dedicated thread. More...

List of all members.

Public Methods

abstract Object construct ()
 Compute the value to be returned by the get method. More...

void finished ()
 Called on the event dispatching thread (not on the worker thread) after the construct method has returned. More...

void interrupt ()
 A new method that interrupts the worker thread. More...

Object get ()
 Return the value created by the construct method. More...

 SwingWorker ()
 Start a thread that will call the construct method and then exit. More...


Protected Methods

synchronized Object getValue ()
 Get the value produced by the worker thread, or null if it hasn't been constructed yet. More...


Detailed Description

An abstract class that you subclass to perform GUI-related work in a dedicated thread.

For instructions on using this class, see http://java.sun.com/products/jfc/swingdoc-current/threads2.html


Constructor & Destructor Documentation

SwingWorker::SwingWorker   [inline]
 

Start a thread that will call the construct method and then exit.


Member Function Documentation

synchronized Object SwingWorker::getValue   [inline, protected]
 

Get the value produced by the worker thread, or null if it hasn't been constructed yet.

abstract Object SwingWorker::construct   [pure virtual]
 

Compute the value to be returned by the get method.

void SwingWorker::finished   [inline]
 

Called on the event dispatching thread (not on the worker thread) after the construct method has returned.

void SwingWorker::interrupt   [inline]
 

A new method that interrupts the worker thread.

Call this method to force the worker to abort what it's doing.

Object SwingWorker::get   [inline]
 

Return the value created by the construct method.

Returns null if either the constructing thread or the current thread was interrupted before a value was produced.

Returns:
the value created by the construct method


The documentation for this class was generated from the following file:
Generated on Tue Jan 8 14:14:28 2002 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001