File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes setting the background Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "setting the background" Watch "setting the background" New topic

setting the background

Osama Hasan
Ranch Hand

Joined: Sep 30, 2002
Posts: 53
hi everyone,
I wanted to ask if it is possible to set an image as a background.
Tell me if there is.
Thanks in advance.

SCJP 1.4<br />SCWCD 1.4
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
this is not the right forum for that kind of question. I'm moving this thread to Java in General (Beginner), please continue that discussion there.
Regarding your question, where do you want to put an image, I mean on the background of what component? A Frame, a Panel, ...?

[Blog] [Blogroll] [My Reviews] My Linked In
Greg Brouelette
Ranch Hand

Joined: Jan 23, 2002
Posts: 144
Go do and click on the "code examples" link. Then click on the "Java" link. Then look at the list of code examples and you'll see a listing called "Tiles an image across the background of a panel". That will give you a code example (with lots of comments) showing how to do what you need to do.
Hope it helps.

For a good Prime, call:<br />29819592777931214269172453467810429868925511217482600306406141434158089
Namnai Kidorkar

Joined: Jul 02, 2005
Posts: 25
Digging up the thread because I've the same question. How to add an image as a back ground of a JPanel and a JFrame?

the is not working, so i'd to ask the question again. the site probably need registration to see the codes but new registration is not working. please help.
miguel lisboa
Ranch Hand

Joined: Feb 08, 2004
Posts: 1281
use this inside JPanel:

java amateur
I agree. Here's the link:
subject: setting the background
It's not a secret anymore!