B
BugFree
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
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