Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Background images for the Frame

 
Makong
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, can somebody tell me how can i insert a background image in my application? tanks!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to make a specialized component ( like JImagePanel below... ) that can paint a graphic in the background. Then, you'll add that component to your frame, and add any new components to it.

-Nate

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
add your image to a JLabel, make the label the size u
wish, add the label last in your list of items being
added to your frame and make sure to make setOpaque(false)
in regards to your other components
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Almost forgot....

Makong,
Please re-register with a name that follows the guidelines of the JavaRanch naming conventions. We require all registered user names to be in the form "first name" + space + "last name". Thanks!
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic