|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.swing.JCSwingWorker
An abstract class that you subclass to perform
GUI-related work in a dedicated thread.
To use this class you override the void implementations of
start()
, construct()
, and finish()
.
The start()
method is called initially and
once this has completed, the construct()
method is launched
in it's own thread. When this thread has completed,
the finish()
method is called from the Swing thread.
It is guaranteed to be safe to alter GUI components in the
start()
and finish()
methods.
To safely alter Swing components in the construct()
method, you
must either create a separate Runnable
class and use
SwingUtilities().invokeLater()
on it, use the convienence object
RunnableObjectWrapper
, or use a thread-safe helper class such as
MessageHelper or ProgressHelper
.
JCSwingRunnable
,
JCMessageHelper
,
JCProgressHelper
Constructor Summary | |
JCSwingWorker()
Starts a thread that will call the construct method
and then exit. |
Method Summary | |
abstract Object |
construct()
Computes 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. |
Object |
get()
Returns the value created by the construct method. |
void |
interrupt()
A new method that interrupts the worker thread. |
void |
start()
Called on the event dispatching thread (not on the worker thread) before the construct method is called. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JCSwingWorker()
construct
method
and then exit.
Method Detail |
public void start()
construct
method is called.
public abstract Object construct()
get
method.
public void finished()
construct
method has returned.
public void interrupt()
public Object get()
construct
method.
construct
method
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |