This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Building a splash screen

 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
Thanks!
Jason
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Enjoy,
Manfred.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic