...
SwingWorker<Boolean, Void> worker = new SwingWorker<Boolean, Void>(){
String a = "a";
getA() {
return a;
}
protected boolean doInBackground() throws Exception{
return true;
}
}
worker.getA();
worker.execute;
...
The code above isn't working, it tells me that getA() (when called in the row before the last) is undefined for SwingWorker.
However, if I make the SwingWorker a separate class, it works without any problems. I may not understand how this works (and I probably don't), but I see no reason making SwingWorker an anonymous inner class would prevent me to call custom methods in it...
Is this even a good idea, or should I make it a separate class? I have no intention of using the SwingWorker anywhere else.