public class ReaderBackground extends SwingWorker<Long,Void>
SwingWorker.execute()
. SwingWorker.done()
.
The last thing, in this class you also can cancel the process by SwingWorker.cancel(boolean)
and check is cancel by SwingWorker.isCancelled()
And SwingWorker.get()
method will return all byte that program read. (URLReader.readAll()
- the result of this method)
SwingWorker.StateValue
Constructor and Description |
---|
ReaderBackground(URLReader reader) |
Modifier and Type | Method and Description |
---|---|
protected Long |
doInBackground()
call
URLReader.readAll() method |
addPropertyChangeListener, cancel, done, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
public ReaderBackground(URLReader reader)
protected Long doInBackground() throws Exception
URLReader.readAll()
methoddoInBackground
in class SwingWorker<Long,Void>
Exception
- have some errorCopyright © 2017. All rights reserved.