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

GridBagLayout background image


Joined: Apr 05, 2002
Posts: 6
I have a java application, where I am using GridBagLayout, utilising North, South, East, West and Center.
I would like to insert a background image which will form the backdrop of the whole window, leaving my existing icons, buttons, text boxes
intact in the foreground.
Any ideas, on the best/easiest way?
Nathan Pruett

Joined: Oct 18, 2000
Posts: 4121

The layout doesn't matter... you'll just need to use a subclass of JPanel like the one below...

Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Younes Essouabni
Ranch Hand

Joined: Jan 13, 2002
Posts: 479
that's great, I was wondering also how to achieve it. Thx a lot
Another question. With some applications, like winamp3, when you start the application, a picture appears with no frame and disapear once the application has fully started. Do you have an idea on how to achieve it?
Thx in advance
[ April 02, 2003: Message edited by: Younes Essouabni ]

By constantly trying one ends up succeeding. Thus: the more one fails the more one has a chance to succeed.
padma Doddapaneni

Joined: Jan 21, 2002
Posts: 5
Using java window class you can acheive this.

Joined: Apr 05, 2002
Posts: 6
Thanks very much.
I'll give it a try at the weekend
Don't get me started about those stupid light bulbs.
subject: GridBagLayout background image