2nd Image won't load in Java Applet?
-
I have 2 images and I am using g.drawImage() to draw them, but only 1 of the 2 images load. Here are the main parts of my code: private Image loginImages[] = new Image[2]; // Array of images MediaTracker tracker = new MediaTracker(this); // MediaTracker to track images. do I need this? in init() method: loginImages[0] = getImage(getDocumentBase(), "test1.gif"); tracker.addImage(loginImages[0], 0); loginImages[1] = getImage(getDocumentBase(), "test2.gif"); tracker.addImage(loginImages[1], 1); in paint method: g.drawImage(loginImages[0] ,0 ,0, this); g.drawImage(loginImages[1], 30, 30, this); Like I said, loginImages[0] loads fine, but loginImages[1] does not show up, even if I comment the first image out. Both of the images are in the same directory, and they are valid .gif files. Am I missing something or doing something wrong? Any suggestions? Thanks.
-
Answer:
Ugh, who uses applets? Note that nowadays everyone uses javascript, ajax, and CSS to give a rich client presentation. We don't use applets anymore. Sorry I can't help with the homework assignment or whatever. I am a professional java developer, but we don't use applets. Nobody does except in very specialized situations.
cheeser1... at Yahoo! Answers Visit the source
Related Q & A:
- Why won't the applets load on our Yahoo online games?Best solution by Yahoo! Answers
- Why won't my audibles load anymore?Best solution by Yahoo! Answers
- Why won't the chatroom lists load?Best solution by support.google.com
- Why won't word racer load?Best solution by Yahoo! Answers
- Facebook games won't load correctly?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.