aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes background image in JPanel or JFrame Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply locked New topic
Author

background image in JPanel or JFrame

Rishabh Rathi
Greenhorn

Joined: Mar 07, 2011
Posts: 13
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.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

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!)
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

We even have an FAQ entry for it.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2172
    
    7
Also, you where given the same answer when you posted the same question over an hour ago!

http://www.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.
Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 4528
    
    5

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.


luck, db
There are no new questions, but there may be new answers.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19670
    
  18

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 )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: background image in JPanel or JFrame