I'm very familiar with Java, just not Applet and GUI design. I'm having a lot of trouble getting my applet to work correctly. Ultimately I would like to have a basemap (map of some place) and then some icons that are visible on top of the map. So I figured I would use a JLayeredPane with the basemap at the lowest level and the icons on higher levels. Right now all I'm getting to display are the icons (which for now are just JLabels) and nothing else. I'm very frustrated...any help is appreciated. My code follows:
Thanks Korol for the response. You said in your reply:
The Icons just add as children to the panel
Can you clarify? Again, I'm not the most familar with applet design. What do you mean add them as children? You mean add the icons (or other small images) to the Panel? Using what function call? Thanks for clearing it up.
then you don't need the basemapLabel, and adjust the panel's paintComponent() as described above. Java will first call paintComponent() on your panel, then call the paint methods of its children. So your labels will be painted on top of the image. , korol
One more quick question...I would like to locate the icons by using an exact location rather than any of the layout managers. For example, I would like to be able to locate an icon at point (X, Y) on the map. I thought I could set it using the "label.setBounds()" method call, but this doesn't seem to work. Any other ideas? Thanks again.
This tiny ad will self destruct in five seconds.
SKIP - a book about connecting industrious people with elderly land owners