This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi all, I am writing an applet which includes several Panels placed on the Applet. I am facing some difficulty in formulating a method to track the loading of all the Images (on all the Panels), so that the main Applet does not start until all Images are available. I can find no examples using anything like this. Has anyone tried to manage the loading of all the Images in a multi-Panel applet? Any ideas are appreciated as usual. Bill
Hi Bill, Why don't you use MediaTracker. It takes a component so just use your main component (i.e., JFrame, JApplet, etc.) or any other common parent to all the panels. Regards, Manfred.
Joined: Sep 19, 2000
Hi Manfred, Thanks, but I am using MediaTracker, but the problem I have seems to be the sequence in which I am trying to do things. I need to : Initialize the Panels on the Applet (which use the Images). Call paint() on the Applet to display the "Please wait..." message. Load the Images using MediaTracker. Display the LoginPanel. The problem is that I am initializing the Panels in the Applet's init() method. Since the Panels need the Images to construct themselves, I can't construct the Panels before the Images load. Since the init() method must complete before paint() is called, I can't get the please wait message to display before loading the images.
Has anyone seen (or created) a multi-panel applet and used MediaTracker to load all the Images used on all panels at once? Every example I have seen uses only the Applet itself as the panel where the Images are displayed.