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 | |
Private Member Functions | |
synchronized void | setValue (Object x) |
Set the value produced by worker thread. | |
Private Attributes | |
Object | value |
see getValue(), setValue() | |
Classes | |
class | ThreadVar |
Class to maintain reference to current worker thread under separate synchronization control. More... |
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.
abstract Object javawrapper::SwingWorker::construct | ( | ) | [pure virtual] |
Compute the value to be returned by the get method.
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.
synchronized Object javawrapper::SwingWorker::getValue | ( | ) | [inline, protected] |
Get the value produced by the worker thread, or null if it hasn't been constructed yet.
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.
synchronized void javawrapper::SwingWorker::setValue | ( | Object | x | ) | [inline, private] |
Set the value produced by worker thread.
x | Value produced by worker thread |