Use a JWindow instead of a JFrame, but see put the logic to set a
reasonable window size in overriden `setPreferredSize()'
In this example I set up a maximum size limitation:
<EXTRACT>
public class PetesSplash extends JWindow
private JLabel labelImage;
private JLabel copyLabel
private Image aSplashImage;
// ...
public PetesSplash( String imageName ) {
// ...
copyLabel = new JLabel( "(c) Dukey Enterprise, 1998" );
// ...
// create and add components and then pack em
pack();
// set the window's bounds, centering the window on the screen
// like a splash window.
Dimension size = getSize();
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
int x = (screen.width-size.width)/2;
int y = (screen.height-size.height)/2;
setBounds(x,y,size.width,size.height);
}
/** Returns the dialog's maximum size */
public Dimension getMaximumSize()
{
Dimension size = getSize();
Dimension limit = new Dimension();
Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
limit.width = screen.width * 2 / 3;
limit.height = screen.height * 2 / 3;
// System.out.println("size:"+size);
// System.out.println("screen:"+screen);
if ( screen.width < 900 ) {
// Low resolution display
limit.width = screen.width * 3 / 4;
limit.height = screen.height * 3 / 4;
}
else {
// High resolution display
limit.width = screen.width * 2 / 3;
limit.height = screen.height * 2 / 3;
}
// System.out.println("limit:"+limit);
if (size.width > limit.width)
size.width = limit.width;
if (size.height > limit.height)
size.height = limit.height;
return (size);
}
...
// ...
}
</EXTRACT>
Pete
______________________________ Reply Separator _________________________________
Subject: JFrame
Author: aa ([EMAIL PROTECTED]) at lon-mime
Date: 04/12/98 10:29
Hi
how kan i show one Frame without border?