Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

background image in JPanel or JFrame

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I want to insert a background image ( .jpg , .gif , .png ) to my JPanel( or JFrame) form to make it look attractive.
PLease suggest the code for it.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Perhaps you might find this surprising, but since Java was invented over a decade ago, you are not the first person to ask this question. In fact you aren't even close to being first. If you use the google keywords "jpanel background image" you will find numerous examples. (Not to mention numerous other posts from people who didn't search before posting!)
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
We even have an FAQ entry for it.
 
Rancher
Posts: 3324
32
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Also, you where given the same answer when you posted the same question over an hour ago!

https://coderanch.com/t/532226/GUI/java/add-background-image-JPANEL

Ignoring peoples answers and wasting our time is NOT a good way to get help in the future.
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Rob Camick wrote:Also, you where given the same answer when you posted the same question over an hour ago!.


Two days and an hour.
 
Rob Spoor
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
But it still wasted my time because the link I posted was already posted. I'm annoyed now so this thread is closed.

(Well, not because I'm annoyed but because one should UseOneThreadPerQuestion )
    Bookmark Topic Watch Topic
  • New Topic