public abstract class SwingWorker
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected HandlingRunnable |
notifier |
Constructor and Description |
---|
SwingWorker(HandlingRunnable notifier)
Create a thread that will call the
work method
and then run |
Modifier and Type | Method and Description |
---|---|
void |
finished()
Called on the event dispatching thread (not on the worker thread)
after the
work method has returned. |
java.lang.Object |
get()
Return the value created by the
work method. |
java.lang.Throwable |
getException()
Get the value produced by the worker thread, or null if it
hasn't been constructed yet.
|
java.lang.Object |
getValue()
Get the value produced by the worker thread, or null if it
hasn't been constructed yet.
|
void |
interrupt()
A new method that interrupts the worker thread.
|
java.lang.Object |
run()
Run the work in the calling thread, and then the
notifier callback. |
void |
start()
Start the worker thread.
|
abstract java.lang.Object |
work()
Compute the value to be returned by the
get method. |
protected HandlingRunnable notifier
public SwingWorker(HandlingRunnable notifier)
work
method
and then runpublic java.lang.Object getValue()
public java.lang.Throwable getException()
public abstract java.lang.Object work() throws java.lang.Throwable
get
method.java.lang.Throwable
public void finished()
work
method has returned.public void interrupt()
public java.lang.Object get()
work
method.
Returns null if either the constructing thread or the current
thread was interrupted before a value was produced.work
methodpublic void start()
public java.lang.Object run() throws java.lang.Throwable
notifier
callback.java.lang.Throwable
Copyright ? 2002 Romain Guy.