Hi all,

I'm trying to build an swing application using the TaskMonitor and run JProgressBar when some action occurs. But I want to do something more elegant and correct. Here is the code:

Java Code:
     private class TestTask extends Task<Void, Void> {

        public TestTask(Application app) {
            super(app);
        }

        @Override
        protected Void doInBackground() throws Exception {
                        System.out.println("Test 0");
        try {//example
            Thread.sleep(3000L);
        } catch (InterruptedException ex) {
            Logger.getLogger(CommerceSysEdView.class.getName()).log(Level.SEVERE, null, ex);
        }
                        System.out.println("Test 1");
           // throw new UnsupportedOperationException("Not supported yet.");
                        return null;
        }

    }
Is there any easier way? without to create an inner class for each action?