Java Download Service Listener
By Rakesh Menon on Feb 08, 2010
One of the previous post [Applet Startup Time] provided a way to measure start-up time of JavaFX Applets. Many responded with requested information (Thanks a lot!). One of the main concern raised was high start-up time for "Without JavaFX Runtime". This is high because it includes time taken to download and install JavaFX Runtime.
Unfortunately there was no way to notify the user about exact progress of this. Hence user will not be able to differentiate between download and install of "JavaFX Runtime" and "JavaFX Application".
Recent JavaFX Update 1.2.3 reduced the download size and start-up time. You can notice this change by trying out the start-up time measurement applet again.. But still it doesn't provide a way to exactly notify the start-up progress. We can only specify a custom splash-screen as specified here.
And then we have Java Update 1.6.0_18 - [Download Now] - Not sure how many of you noticed this feature - Download Service Listener It allows you to provide a Custom Progress UI using AWT/Swing/Java2D APIs. It has callback methods which will provide information related to download and validation of resources. Please refer to Download Service Listener Example for more information. Refer to ProgressListener.java and ProgressView.java for implementation used in this sample.
<script src="http://dl.javafx.com/1.2/dtfx.js"></script> <script src="http://javafxdemos.googlecode.com/hg/resource/ProgressListener/ProgressListenerFX.js"></script>
- Download Service Listener Example
- JavaSE 1.6.0_18 Release Notes
- DownloadServiceListener Implementation
- Custom Progress UI
Hmm.. thatz a long post with lots of information.. But I think its very useful.. As usual, please try it out and let me know feedback..