superjoebob
Senior Newbie 
|
 |
«
Posted
2011-06-07 06:08:02 » |
|
I've been incredibly curious about how to display the download progress of an applet. I'm using Java Web Start, JOGL, and a few other libraries right now, and when I load up my applet it displays a progress bar and the Java logo. What does this progress bar represent, is it the download progress of all my libraries and Jars?
If not, how would I go about setting up a download progress bar for my applet? I've looked into class loaders but that seems to cover only the loading of my main applet, and not any libraries it's using. There doesn't seem to be a whole lot of documentation on this issue and I'm really not sure where to start.
Any tips?
|
|
|
|
ra4king
|
 |
«
Reply #1 - Posted
2011-06-07 06:45:32 » |
|
Yes that progress bar is for all your jars and native code. The only reason you would want a progress bar is for loading resources such as images and sound.
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #2 - Posted
2011-06-07 07:38:47 » |
|
So then the download bar is covered, I only need a bar for the physical loading of my assets into memory?
|
|
|
|
Games published by our own members! Check 'em out!
|
|
ra4king
|
 |
«
Reply #3 - Posted
2011-06-07 08:12:48 » |
|
You don't necessarily need one but yes. You shouldn't be worrying about actual jar files and native code to be loaded.
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #4 - Posted
2011-06-07 09:46:43 » |
|
Thanks, that's an absolute relief. Without the provided Java loading bar it would have been incredibly painful.
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #5 - Posted
2011-06-08 06:47:58 » |
|
I am curious though, my applet loads up almost instantly when run through the IDE and when run in a web page offline, but as soon as I run the applet in a browser online, my loading animation for the applet plays much longer. The loading animation I created plays for about 0.5 seconds offline, and it plays for about a minute online. What could be causing something like this, is something downloading after the java logo loader?
|
|
|
|
ra4king
|
 |
«
Reply #6 - Posted
2011-06-08 07:06:54 » |
|
Well maybe you have a ton of resources that are being downloaded on a slow internet.
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #7 - Posted
2011-06-08 07:13:21 » |
|
I believe that is the case, but the animation I've got playing right when the applet starts is a small rotating gear, which changes to a larger rotating gear with a progress bar for loading the assets into memory after JOGL loads up. The java logo loader appears first, stays up for about 5 seconds, then immediately goes to the small rotating gear which stays on for about a minute when online, about 0.5 seconds offline. That's why I've been led to believe that once my little animated gear pops up, downloading continues to happen.
For my applet structure I pretty much have a Jar with all the game code and resources in it. Then, I have a lib folder alongside the jar which contains all the libraries I'm using including MySQL, an Audio library, etc.
|
|
|
|
ra4king
|
 |
«
Reply #8 - Posted
2011-06-08 08:11:19 » |
|
How big are all your jars and folders?
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #9 - Posted
2011-06-08 10:33:11 » |
|
All the Jars and folders come out to around 4 megs.
|
|
|
|
Games published by our own members! Check 'em out!
|
|
ra4king
|
 |
«
Reply #10 - Posted
2011-06-08 19:01:32 » |
|
Depending on your web server's bandwidth and internet speeds, that is a lot.
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #11 - Posted
2011-06-08 21:15:39 » |
|
Which is why I'm curious about how to make a download progress bar for my game  .
|
|
|
|
ra4king
|
 |
«
Reply #12 - Posted
2011-06-09 00:27:35 » |
|
Well as I said, the loading of jars and native code is already taken care of by that Java icon with the rotating blue squares. If it takes 1 minute to load audio, images, and other resources then so be it, you can't really boost their download speeds  But when the Java logo and JOGL loading gears are done, that means they've finished loading all vital code and have started executing your code.
|
|
|
|
zoto
|
 |
«
Reply #13 - Posted
2011-06-09 00:40:15 » |
|
|
|
|
|
ra4king
|
 |
«
Reply #14 - Posted
2011-06-09 01:18:19 » |
|
@zoto Oh wow! I didn't you could replace Java's loading screen!
|
|
|
|
superjoebob
Senior Newbie 
|
 |
«
Reply #15 - Posted
2011-06-10 19:29:17 » |
|
Me neither(obviously XD), that may very well be just what I'm looking for! I'll give it a try, thanks zoto.
|
|
|
|
|