Results 1 to 1 of 1
- 02-10-2011, 03:43 PM #1
A simple way to use TaskMonitor in Netbeans
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:
Is there any easier way? without to create an inner class for each action?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; } }
Similar Threads
-
30 line simple gui, simple error, need help
By cc11rocks in forum New To JavaReplies: 6Last Post: 02-05-2011, 08:33 PM -
Drawing simple graphics in NetBeans
By arifin in forum AWT / SwingReplies: 1Last Post: 11-12-2010, 10:01 AM -
New simple application using a simple database
By webbusiness23 in forum New To JavaReplies: 9Last Post: 08-03-2009, 02:55 AM -
Simple Help....
By jpnym15 in forum New To JavaReplies: 1Last Post: 11-11-2008, 02:33 PM -
Help with a very simple method for a very simple beginner.
By cakeman in forum New To JavaReplies: 2Last Post: 05-04-2008, 05:27 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks