Re: Size of a java applet
Fabian Steiner wrote:
...
I am currently working on a java applet which is able to draw charts.
Unfortunately, the compiled jar-archive with the third party modules
(JFreeChart, JCommon, netBeans GUI library) is around 1.5MB large, so it
takes quite some time until the applet is loaded in the browser. Is
there any possibility to reduce this filesize (packaging, etc.)?
In fact, my own application is only about 30kB large but the other
libraries bring such an overhead along.
In addition to the NetBeans/obfuscation points.
Therer are a number of ways to ensure
1) something appears for your users early on, and
2) the applet appears ASAP.
In response to 1) you might
a) use a 'loader' applet to indicate loading
progress of the main applet.
b) wrap your applet in WebStart - if you specify the Jar
sizes, JWS will indicate the download progress.
In response to 2) you might
Load the minimum necessary classes to get the applet
on-screen, then start a thread to construct and show any
...graphs, whatever.
Now, that is not especially useful for applets where
it takes longer to donwload the right jar than it does to
construct the GUI. *However* you can gain that advantage
back, again if you launch using WebStart - resources
(jar files) can be specified as a 'lazy' download -
not downloaded until required.
HTH
Andrew T.