Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / April 2006

Tip: Looking for answers? Try searching our database.

How do I make the menu bar accessible if i'm using the glass pane

Thread view: 
BugFree - 23 Apr 2006 05:52 GMT
Hi I'm trying to create a program that uses a image as a background.
When i figured out how to set the image to the background of the gui it
wouldn't let me place buttons or textfields on top of it. This is how i
did it...

((JPanel)getContentPane()).setOpaque(false);
ImageIcon image = new ImageIcon("usamap.gif");
JLabel backlabel = new JLabel(image);
getLayeredPane().add(backlabel, new Integer(Integer.MIN_VALUE));
backlabel.setBounds(0,0,image.getIconWidth(), image.getIconHeight());

This way I was unable to place the buttons i needed over top.  So I
tried to use the glass pane for that which worked but now my menu bar
does not respond.  Any ideas on how I could fix this problem or a
better way to place the image in the background and still use buttons
on it would be greatly apreciated.

Thanks
Monique Y. Mudama - 23 Apr 2006 19:01 GMT
> Hi I'm trying to create a program that uses a image as a background.
> When i figured out how to set the image to the background of the gui it
[quoted text clipped - 12 lines]
> better way to place the image in the background and still use buttons
> on it would be greatly apreciated.

I've never used it, but what about the OverlayLayout?

http://www.java2s.com/Code/Java/Swing-JFC/AtestoftheOverlayLayoutmanagerallowing
experimentation.htm


Signature

monique

Help us help you:
http://www.catb.org/~esr/faqs/smart-questions.html

BugFree - 23 Apr 2006 22:16 GMT
I don't really know anything about the overlay layout i'm not sure i
know how to use it but i'll give it a try

thanks


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.