Consider following SWT code example:
How can I separate the inline defined class?
Thread thread = new Thread() {
public void run() {
...
}
};
I want to define a separate class which updates the table just like it does here. How do I pass the list back to the table? Example code?
Just create a
classwhichextends Thread.and create it as follows:
The normal practice is however to implement
Runnable:Or if you want a
Threadwhich returns a result, implementCallable<T>whereTrepresents the return type.Both can be executed using the
ExecutorService.