• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Background image

 
Rocky Summers
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys,
just wondering how i can add a background image in a swing program..
~ rockster
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rocky, if you search this forum you will find that this question has been asked and answered a LOT. But the gist of it is overriding the paintComponent(Graphics g) method of a Swing component (usually a JPanel) and drawing the image in that method. You can also just place an ImageIcon on a component but you will have problems placing other components on top of that. So the paintComponent is the way to go if you are looking for a wallpaper type of feature.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic