Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Jul 2005
placing multiple images in Jframe
I am creating an imageicon from an image and then adding it on Jlabel,then adding that to Jpanel and then fiinally to jframe
I want to add an extra image on top of the original image(both images need to be displayed)
This is regarding a multiplayer game where i need to place the image of a player over the background
Can sometell me what i need to do?Do i have to add an extra Jlabel or an extra Jpanel.
Thank youThe strong shall live and the weak will die
In the end,only the fittest survive in this world
- Shishio Makoto
Ok, you need to put the background image on the JPanel, and put the foreground image on the JLabel. Add the JLabel to the JPanel, and make sure that you use setOpaque(false) on the JLabel. This should (note: should, I've never tried this) make everything beyond the image borders transparent.
Hope I helped!