Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / May 2004

Tip: Looking for answers? Try searching our database.

Repeat image loading problem in applet

Thread view: 
Michael.R.Harris - 18 May 2004 19:23 GMT
An applet runs inside MS explorer.  It loads four images plus various other
buttons to initialize.  Each time it is re-called inside the same explorer
window new images are
loaded.  All works well for the first two loads but subsequent loading takes
longer and longer and partial images and errors appear.  Closing the browser
and starting over restarts the whole process again.  It would appear that
things are not getting cleaned-up properly when the game is re-loaded but
since garbage collection is automatic I don't know how to improve the
situation.

Any suggestions gratefully received.....Michael.
Andrew Thompson - 18 May 2004 20:14 GMT
> An applet runs inside MS explorer.

Many do.  Got an URL for this one in particular?

>.. It loads four images plus various other
> buttons to initialize.  Each time it is re-called inside the same explorer
> window new images are
> loaded.  All works well for the first two loads but subsequent loading takes
> longer and longer and partial images and errors appear.  

It sounds as though you might not be properly
disposing of the graphics object, I *understand*
(though am not sure) that can cause the symptom
you describe.

Check the GUI FAQ for a passing reference to it..
<http://www.physci.org/guifaq.jsp#2.4>

..I am sure I have heard Thomas mention
something more definitive than that.

It would certainly be helpful to link to
the applet web page annd source.  Trim the
source first, it may show you what you are
doing wrong in any case.  For tips..
<http://www.physci.org/codes/sscce.jsp>

You can put them up at Geocities for free.  
It took me about 30 mins to join and upload
my first page the other night (I did it just
to test the theory).

Signature

Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology

Michael.R.Harris - 19 May 2004 16:21 GMT
Running my applet inside netscape does not exhibit the same symptoms,
everything works fine.  Still cannot solve problem in Explorer though;  have
tried
- overwritting destroy to flush each image then call System.gc then
super.destroy
- call System.gc at start of each game
- inserting a MediaTracker to wait for all images to load before allowing
thread to run
Images certainly load more cleanly but when the third game loads the
problems start and only get resolved by opening a new browser window.  I am
beginning to think I will have to open each game in new window to force the
complete clean up of resources in the JavaVM but this will be very
cumbersome.

Thanks for your suggestions BTW....Michael.

> > An applet runs inside MS explorer.
>
[quoted text clipped - 27 lines]
> my first page the other night (I did it just
> to test the theory).
Andrew Thompson - 19 May 2004 23:17 GMT
>>> An applet runs inside MS explorer.
>>
>> Many do.  Got an URL for this one in particular?

I high-lighted this again.  Problems can usually
be solved so much quicker with an URL.

(Geocities is free)

Signature

Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.