|
class | ThreadVar |
| Class to maintain reference to current worker thread under separate synchronization control. More...
|
|
|
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...
|
|
void | start () |
| Start the worker thread. More...
|
|
|
synchronized Object | getValue () |
| Get the value produced by the worker thread, or null if it hasn't been constructed yet. More...
|
|
|
synchronized void | setValue (Object x) |
| Set the value produced by worker thread. More...
|
|
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.
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.
◆ SwingWorker()
sortie.parfile.SwingWorker.SwingWorker |
( |
| ) |
|
Start a thread that will call the construct method and then exit.
◆ construct()
abstract Object sortie.parfile.SwingWorker.construct |
( |
| ) |
|
|
abstract |
Compute the value to be returned by the get method.
- Returns
- value to be returned by get method
◆ finished()
void sortie.parfile.SwingWorker.finished |
( |
| ) |
|
Called on the event dispatching thread (not on the worker thread) after the construct method has returned.
◆ get()
Object sortie.parfile.SwingWorker.get |
( |
| ) |
|
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
◆ getValue()
synchronized Object sortie.parfile.SwingWorker.getValue |
( |
| ) |
|
|
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
◆ interrupt()
void sortie.parfile.SwingWorker.interrupt |
( |
| ) |
|
A new method that interrupts the worker thread.
Call this method to force the worker to stop what it's doing.
◆ setValue()
synchronized void sortie.parfile.SwingWorker.setValue |
( |
Object |
x | ) |
|
|
private |
Set the value produced by worker thread.
- Parameters
-
x | Value produced by worker thread |
◆ start()
void sortie.parfile.SwingWorker.start |
( |
| ) |
|
◆ threadVar
ThreadVar sortie.parfile.SwingWorker.threadVar |
|
protected |
12-8-2004 (LEM) - made this protected so I could have access to it in the children
◆ value
Object sortie.parfile.SwingWorker.value |
|
private |
The documentation for this class was generated from the following file: