I'm making a game using swing with a JPanel for level selection and JButtons set up for navigating to the levels. I've also created a .png image for the entire level screen - is it possible to render the image on top of the JButtons? If not, what's the simplest alternative?
Asked
Active
Viewed 106 times
0
-
Do you want to have a single image over all the buttons, or do you want a button to have an image on it? – steve Jun 10 '15 at 18:47
-
Use the approach shown in this [duplicate](http://stackoverflow.com/q/10861852/230513). – trashgod Jun 10 '15 at 18:50
-
Why make a game using swing? Swing is not for making games. You have so many other good options for java like libgdx, slick2d (it is old), etc. Also if you want to work a little harder, you can use lwjgl. – anonymous Jun 10 '15 at 18:51
-
I have to use swing because it's for a school assignment – Leirion Jun 10 '15 at 20:40
-
One image over all buttons – Leirion Jun 10 '15 at 20:41
1 Answers
0
I'm not sure if what you want to do is possible, but my approach has usually been to use a mouse listener instead. Just check for clicks within a certain area handle them.

JShell
- 624
- 2
- 7
- 22