• Post Reply Bookmark Topic Watch Topic
  • New Topic

When I set the ContentPane (Wallpaper) for the JFrame, the rest never shows up again

 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Any ideas I can have a background image.
A 2nd question, how do we make the "wallpaper" extend to how much the window can cover (usable space of my application), as much as possible?
Thanks
Jack
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of using the JLabel with an Icon, use a panel with a background image.
Check out https://www.coderanch.com/how-to/java/BackgroundImageOnJPanel

After that you would (like always) set the proper layout to the panel and add child components to it
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:Instead of using the JLabel with an Icon, use a panel with a background image.
Check out https://www.coderanch.com/how-to/java/BackgroundImageOnJPanel

After that you would (like always) set the proper layout to the panel and add child components to it



Sounds like magic, thanks
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!