flaviojmendes
Veja se esse exemplo te ajuda:
public class SplashWindow1 extends JWindow
{
public SplashWindow1(String filename, Frame f)
{
super(f);
JLabel l = new JLabel(new ImageIcon(filename));
getContentPane().add(l, BorderLayout.CENTER);
pack();
setBounds(400, 300, 300, 300);
Dimension screenSize = new Dimension(400, 300);
// Toolkit.getDefaultToolkit().getScreenSize();
Dimension labelSize = l.getPreferredSize();
// setLocation(screenSize.width/2 - (labelSize.width/2),
// screenSize.height/2 - (labelSize.height/2));
setVisible(true);
screenSize = null;
labelSize = null;
addMouseListener(new MouseAdapter()
{
public void mousePressed(MouseEvent e)
{
setVisible(false);
dispose();
}
});
}
public static void main(String[] args) {
SplashWindow1 sp = new SplashWindow1("C:/a.jpg", new JFrame(){
@Override
public void setBounds(int x, int y, int width, int height) {
// TODO Auto-generated method stub
super.setBounds(300, 300, 300, 300);
setVisible(true);
}
});
}
}
Abraço.