Computer Science Canada Problem with layering Icons |
Author: | goober69 [ Mon Jun 02, 2008 3:30 pm ] | ||
Post subject: | Problem with layering Icons | ||
Hey guys, quick question. I made this little prog that loads numbers from a text file that coorespond with tiles to display on the screen. The program compiles fine, and the tiles are displayed exactly how I want on the screen (using ImageIcon), but when I try and load an image ontop of them (once again using ImageIcon, the image does not display. Funny thing is when I don't display the tiles, the image is displayed, so I think it's being loaded under the tile images :S Any help is appreciated.
|
Author: | HellblazerX [ Mon Jun 02, 2008 4:09 pm ] |
Post subject: | Re: Problem with layering Icons |
I don't believe you stack JLabels on top of one another, however, you can do it with JLayeredPanes. However, for you program (I'm assuming you're making a Mario game), I would recommend you do your graphics with the paint method rather than with Swing (JLayerPanes were created with the idea of overlapping windows in mind, not animations). |
Author: | goober69 [ Tue Jun 03, 2008 8:01 am ] |
Post subject: | Re: Problem with layering Icons |
alright, i've already looked into the JLayeredPane thing, and when I tried to implement it, none of my images showed up in my window... I'd like to use the Graphics.DrawImage or w.e, but I've read through countless tutorials on it and it confuses the bejesus out of me :S If you could maybe help me out on that I think I could take it from there.. |