javawrapper::SwingWorker Class Reference

* This is the 3rd version of SwingWorker (also known as SwingWorker 3), an abstract class that you subclass to perform GUI-related work in a dedicated thread. More...

List of all members.

Public Member Functions

abstract Object construct ()
 Compute the value to be returned by the get method.
void finished ()
 Called on the event dispatching thread (not on the worker thread) after the construct method has returned.
void interrupt ()
 A new method that interrupts the worker thread.
Object get ()
 Return the value created by the construct method.
 SwingWorker ()
 Start a thread that will call the construct method and then exit.
void start ()
 Start the worker thread.

Protected Member Functions

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

Protected Attributes

ThreadVar threadVar
 12-8-2004 (LEM) - made this protected so I could have access to it in the children


Detailed Description

* This is the 3rd version of SwingWorker (also known as SwingWorker 3), an abstract class that you subclass to perform GUI-related work in a dedicated thread.

For instructions on and examples of using this class, see:

http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

Note that the API changed slightly in the 3rd version: You must now invoke start() on the SwingWorker after creating it.

I (LEM) downloaded this from the Java tutorial. This allows me to do some minor multi-threading.


Constructor & Destructor Documentation

javawrapper::SwingWorker::SwingWorker (  )  [inline]

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


Member Function Documentation

synchronized Object javawrapper::SwingWorker::getValue (  )  [inline, protected]

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

Returns:
Object Value produced by worker thread

abstract Object javawrapper::SwingWorker::construct (  )  [pure virtual]

Compute the value to be returned by the get method.

Returns:
value to be returned by get method

void javawrapper::SwingWorker::interrupt (  )  [inline]

A new method that interrupts the worker thread.

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

Object javawrapper::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 Thu May 24 09:34:55 2007 for SORTIE Java Interface by  doxygen 1.5.2