I have a ball class which moves in a circle like a particle I want to place a background image behind the ball panel.
Asked
Active
Viewed 305 times
0
-
you may want to take a look at [this post](http://stackoverflow.com/questions/1466240/how-to-set-an-image-as-a-background-for-frame-in-swing-gui-of-java) – Turing85 Nov 13 '14 at 19:08
-
You might want to have a look at this: http://sourceforge.net/p/tus/code/HEAD/tree/tjacobs/ui/swing_ex/JPanelCustomBkground.java it is a broader solution which uses Paint rather than Image... The main method demonstrates how to get a Paint from an Image – ControlAltDel Nov 13 '14 at 19:11
-
For [example](http://stackoverflow.com/a/3256941/230513). – trashgod Nov 13 '14 at 19:25
-
Another [example](http://stackoverflow.com/questions/13944795/trouble-figuring-out-how-to-set-background-image/13945145#13945145) – MadProgrammer Nov 13 '14 at 20:01
1 Answers
0
You can place JLabel on bottom layer with image set as Icon. Make it as large as frame and voila.

Antoniossss
- 31,590
- 6
- 57
- 99