Take a look at this: Simple background tasks .
You seem to have two problems. Firstly, regarding the amount of code needed when using SwingWorker: you need to create a subclass SwingWorkerfor each action, but this does not mean that they must be at the top level, they are called classes or the files themselves. They can be anonymous classes, as shown in the article, so the code is inside your GUI event handling code.
-, SwingWorker: SwingWorker, (, ), - .