I have a question regarding SwingWorker and Java GUI's.
I have several classes which process information, we can call them Foo1
, Foo2
, and Foo3
. This processing can take a very long time.
These are all subclasses of Foo
, however Foo
is not called directly itself (the Foo[x]
classes use methods inherited from Foo
. In order to keep the EDT free to paint a progress bar, what is the best way to use SwingWorker
when keeping my object hierarchy? Is it possible to have wrapper classes such as Foo1Worker extends SwingWorker
and have its doInBackground()
call Foo1.myProcessMethod()
? Even though Foo1
does not extend SwingWorker
, will this still work as I expect it to?
edit: to clarify my question, how can I make Foo[x]
SwingWorkers even though they are already subclasses?