Author
background image in JPanel or JFrame
Rishabh Rathi
Greenhorn
Joined: Mar 07, 2011
Posts: 13
posted Mar 29, 2011 13:10:06
0
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: 16482
posted Mar 29, 2011 13:16:48
0
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: 19216
posted Mar 29, 2011 13:28:20
0
We even have an FAQ entry for it.
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Rob Camick
Ranch Hand
Joined: Jun 13, 2009
Posts: 1787
posted Mar 29, 2011 14:30:57
1
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: 4163
posted Mar 29, 2011 15:40:51
0
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: 19216
posted Mar 30, 2011 01:26:42
0
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 )
subject: background image in JPanel or JFrame