Java Virtal Machine.net

[ News ] rss

February 01, 2011

Mark Wielaard: New GPG key. Finally created a new GPG key using gnupg. The old one was a DSA/1024 bits one and 8 years old. The new one is a RSA/2048 bits one. I will use the new one in the future to sign any release tarballs I might create. pub 2048R/57816A6A 2011-01-29 Key f...

More »

February 01, 2011

Andrew Hughes: [SECURITY] IcedTea6 1.7.8, 1.8.5, 1.9.5 Released!. We are pleased to announce a new set of security releases, IcedTea6 1.7.8, IcedTea6 1.8.5 and IcedTea6 1.9.5. This update contains the following security updates: The IcedTea project provides a harness to build the source code from OpenJDK6 u...

More »

April/2024
SunMonTueWedThuFriSat
 123456
78910111213
14151617181920
21222324252627
282930    

[ Archives News
for 'Java Technology' ]

home > news > java technology > did you know that swingworker can send progress status?

Did you know that SwingWorker can send progress status?

Java 6 comes with SwingWorker as an integral part of the JRE (yes, you no more need to download it). And THAT version of SwingWorker can send progress status while the background work still is in progress. Using this new feature, it is possible to do a lengthy background operation that reports its status from time to time. For example: While loading thousands of rows from the server (which might need several seconds) you could return once a second so-called "chunks" of let's say ten or hundred rows and visualize them meanwhile. That means, the users sees how more and more data gets shown. That is much better than just showing an hourglass pointer. And it is really much better than not showing anything and even do not redraw. Since the SwingWorker correctly uses Swing's event thread to draw the "chunks", you will even see no repaint problems. Everything just looks pretty nice and behaves really responsive (just as you would love it if you would be a user). Here is a small test program that demonstrates the behaviour. It shows a frame with a slider and a button. A background thread needs one minute to finish, and sends a progress status (here: the current number of seconds it was running so far) to the Swing event thread. That thread then paints the slider in the new position. The cool thing is that the UI is completely responsive. That means, not only the UI i...


Date: January, 03 2010
Url: http://www.java.net/blog/mkarg/archive/2010/01/03/did-you-know-swingworker-can-send-progress-status


Others News

©2002-2019Java-Virtual-Machine.net website designer | free icon fonts | formoid.com | bootstrap website builder | free website generator