Applet not showing images
I am writing an applet to play a little card game. Basically I have completed the applet and it works fine when i run it from console using the appletviewer. However, when I run it from a web page or from within my IDE (Forte for Java), only 2 images display in my game. The game still runs perfectly and I checked the Image objects and they are not null. They are just not showing up in the applet. I have tried many things to debug this and I have come to the conclusion that it has something to do with my .jpgs. Has anyone ever encountered this problem?? If so how do I fix it??? I can't play my game with only the 6 of clubs! lol. Note, I am trying to avoid posting code in here but I will if I have to, basically I'm like 99% sure it is not my code because I've been searching the net for 2 days looking for solutions to this and have modified my code many times to account for errors. Also, why would the six of clubs show if had something to do with my code? All the cards are loaded the same way. I believe it has something to do with the security on the .jpgs, only I dont know how the one card got away with it because all cards were created the same way. Any help would be greatly appreciated!
This sounds like your code is a bit too hasty.... Are you using MediaTracker to wait
for the images to load completely ? Running an applet from the console is not the
same with respect to image load time as for running it as a "real" applet.
And, an image object that isn't null, does not guarantee that this object is
filled with pixels,
PS. I use MediaTrackers for image load regardless if its local applications or applets.
Last edited by sjalle; 04-18-2005 at 05:09 AM.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL