This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Building a splash screen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Building a splash screen" Watch "Building a splash screen" New topic

Building a splash screen

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
I'm trying to build a splash screen to give info when someone chooses Help->About. I have data that is kept in an .ini file that displays the title, current version, etc. I would like to have an image show in the background, with the data that is read from the ini displayed on top of it.
I can use a JLabel to display the image no problem, and I can use labels to display the data, but I can't get both to go (been using GridBagLayout). Haven't been able to find any methods like bringToFront() for JLabels, either.
Any suggestions on where to start with this?
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Jason,
If you want the image behind other components you will need to draw it. You can use things like JLayeredPane but it gets messy because of menus, cursors, and other UI elments.
The code below shows a class that has a background image.

jason adam
Chicken Farmer ()
Ranch Hand

Joined: May 08, 2001
Posts: 1932
Thanks Manfred, I'll tinker with it and see what I come up with. I'm using just a regular application instead of an applet, should be easy enough to convert.
I agree. Here's the link:
subject: Building a splash screen
Similar Threads
Require - Splash Screen Images, Icons etc
Putting variable text over a splash screen
splash screen prob. on Mac OS X
options in jar files....
JFrame Calls..