3

OK, let's say I have this Image:

ImageIcon imageBack = new ImageIcon(System.getenv("APPDATA") + "\.my_game\bg.png");

and I have a JPanel that I can toggle on and off. How do I get that JPanel to use the custom ImageIcon?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
test
  • 17,706
  • 64
  • 171
  • 244

1 Answers1

5

Depending on your requirement you can use one of the solutions from Background Panel.

camickr
  • 321,443
  • 19
  • 166
  • 288
  • +1 for excelent code, basic stuff http://download.oracle.com/javase/tutorial/uiswing/components/icon.html – mKorbel Aug 19 '11 at 16:19