September 03, 2010, 10:43:46 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  Home Help Media Affiliates Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: Improving Applet Startup Time  (Read 2251 times)
0 Members and 1 Guest are viewing this topic.
lokesh05
Member
*

Reputation: 0
Offline Offline
Gender: Male
Posts: 32
Referrals: 0

Awards
« on: July 02, 2008, 10:48:15 PM »

When you are creating a commercial Web page that is covered with Java applets, you want to get results to the user as quickly as possible. Web browsers tend to leave a big blank spot on the page where an applet is supposed to go. If your applet takes 30 seconds to load, someone may not be patient enough to wait for it. In fact, he may not even know there is an applet being loaded. It would be nice if you could at least print a message telling the user that an applet is being loaded that is going to blow his socks off, so he should sit in rapt anticipation for your wonderful-but-huge applet to be downloaded. As it turns out, this is a snap! You can create a very small applet that downloads the real applet in the background. The only trick to this is that when you create an applet manually, it doesn't know its code base or document base. It does, however, have a method called setStub that tells it where to go for this information. Almost every method in the AppletStub interface is implemented in the Applet class, which means that your loader applet can act as an applet stub for another applet. The only method in the AppletStub interface that isn't in the Applet class is appletResize. Your appletResize method can simply call the resize method in your loader applet, since that will perform the actual resize.
Quote
The appletResize method in this case is performing a technique called "delegation." The appletResize method delegates the responsibility of performing the resizing to the resize method. You often use this technique in object-oriented programming where one object has a set of methods that delegate their responsibility to methods in another object.
So, making use of another applet to call on to your original one is a good trick to speed up load times of Applets. This I found useful when I was working on a very heavy applet which had lots of frames and code line exceeding 20000 lines!
Though i have found that the new Java build (1.6 onwards) support faster loading of JRE on the systems, but still it's worth a try!
Logged
Javaforums.net/forum :: A friendly community for software developers and students that want to learn Java!
« on: July 02, 2008, 10:48:15 PM »

 Logged
Jormigo
Member
*

Reputation: 0
Offline Offline
Gender: Male
Posts: 51
Referrals: 0

Awards
« Reply #1 on: June 01, 2009, 11:21:26 PM »

why cant they just be a bit more patient haha
Logged
oxymoron
Junior Member
*

Reputation: 0
Offline Offline
Posts: 1
Referrals: 0

Awards
« Reply #2 on: September 09, 2009, 02:25:51 AM »

Any chance of a code example?
Logged
jurka
Staff
Member
*
*

Reputation: 5
Offline Offline
Posts: 188
Referrals: 0

Awards
« Reply #3 on: September 09, 2009, 03:24:33 AM »

What about loading applet as external app to Swing GUI ?
Logged
Javaforums.net/forum :: A friendly community for software developers and students that want to learn Java!
   

 Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.10 | SMF © 2006-2009, Simple Machines LLC
TinyPortal v0.9.8 © Bloc
Valid XHTML 1.0! Valid CSS!
Page created in 0.523 seconds with 38 queries.

Google visited last this page August 20, 2010, 11:08:06 AM