posted 22 years ago
Thank you Gregg.
I tried this, I'm adding the Label to a DesktopPane which ignores
the bounds (at least the x, y coordinates):
ImageIcon icon = new ImageIcon("O:\\logo.jpg");
JLabel label = new JLabel(icon);
label.setBounds(0, 0, icon.getIconWidth(), icon.getIconHeight());
java.awt.Dimension screen = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
int dx = icon.getIconWidth();
int dy = icon.getIconHeight();
int xwidth = (screen.width-dx)/2;
int yheight = (screen.height-dy)/2;
myDesktop.add( label, JLayeredPane.FRAME_CONTENT_LAYER);
my other problem is, that the size of my
desktop is not equal to the size of the screen and I would
like to use a kind of LayoutManager, so I won't have to
change the position of the label every time the size of
the desktop changes.
regards,
Felix