Results 1 to 2 of 2
Thread: Image atop another image in GUI
- 12-10-2010, 04:26 PM #1Member
- Join Date
- Dec 2010
- Rep Power
Image atop another image in GUI
I'm currently creating a simple monopoly-game in Java for class. Since I need to show all of the streets, and sometimes players atop the streets, I need to use some component in the swing library which can accomplish this.
I've tried JLabel and JLayeredPane but I haven't gotten any of these to work. Does anyone know what I should use.
tl;dr: I want to put an image atop another image in a squared box(like a JLabel), how to accomplish?
I would have the game square be a JPanel with a background image and the playing piece a JLabel that sits on the JPanel. If you want to be able to move the piece, then a JLayeredPane would work well. You can search this forum for examples of this including examples of chess board or checkers board. Otherwise, I'm not sure how to help you further when you say "it doesn't work" but don't provide details.
- By Cain in forum Java 2DReplies: 1Last Post: 04-17-2009, 01:44 AM
- By sruthi_2009 in forum AWT / SwingReplies: 14Last Post: 04-10-2009, 09:46 AM
- By SpaceY in forum New To JavaReplies: 2Last Post: 11-11-2008, 02:25 PM
- By hunterbdb in forum Java 2DReplies: 9Last Post: 10-30-2008, 07:17 PM
- By archanajathan in forum Advanced JavaReplies: 0Last Post: 01-08-2008, 06:29 PM