API Overview API Index Package Overview Direct link to this page
JDK 1.6
  javax.swing. SwingWorker View Source
Author(s)
Igor Kushnirskiy
Since
1.6
Version
1.8 11/30/06
Serial
Hierarchy
 Object
      SwingWorker
Implements
 RunnableFuture
Subclasses
Description
publicabstract abstract class SwingWorker
  An abstract class to perform lengthy GUI-interacting tasks in a dedicated thread.
See also:   
Constructors
public SwingWorker ()
Constructs this SwingWorker.
Methods
Hide/Show inherited methods
publicfinal void addPropertyChangeListener (PropertyChangeListener listener)
  Adds a PropertyChangeListener to the listener list.
publicfinal boolean cancel (boolean mayInterruptIfRunning)
  Attempts to cancel execution of this task.
protectedabstract T doInBackground () throws Exception
  Computes a result, or throws an exception if unable to do so.
protected void done ()
  Executed on the Event Dispatch Thread after the doInBackground method is finished.
publicfinal void execute ()
  Schedules this SwingWorker for execution on a worker thread.
publicfinal void firePropertyChange (String propertyName, Object oldValue, Object newValue)
  Reports a bound property update to any registered listeners.
publicfinal T get () throws InterruptedException ExecutionException
  Waits if necessary for the computation to complete, and then retrieves its result.
publicfinal T get (long timeout, TimeUnit unit) throws InterruptedException ExecutionException TimeoutException
  Waits if necessary for at most the given time for the computation to complete, and then retrieves its result, if available.
publicfinal int getProgress ()
  Returns the progress bound property.
publicfinal PropertyChangeSupport getPropertyChangeSupport ()
  Returns the PropertyChangeSupport for this SwingWorker.
publicfinal StateValue getState ()
  Returns the SwingWorker state bound property.
publicfinal boolean isCancelled ()
Returns true if this task was cancelled before it completed normally.
publicfinal boolean isDone ()
  Returns true if this task completed.
protected void process (List< V> chunks)
  Receives data chunks from the publish method asynchronously on the Event Dispatch Thread.
protectedfinal void publish ( V chunks)
  Sends data chunks to the SwingWorker.process(java.util.List) method.
publicfinal void removePropertyChangeListener (PropertyChangeListener listener)
  Removes a PropertyChangeListener from the listener list.
publicfinal void run () [Specified in RunnableFuture]
Sets this Future to the result of computation unless it has been cancelled.
protectedfinal void setProgress (int progress)
  Sets the progress bound property.
Fields
Hide/Show inherited fields
Nested Classes
  SwingWorker.StateValue
Values for the state bound property.
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar