Hi there!
Might want to check the Java Tutorial, which explains how to do it.
Here's how I did it recently in a JWindow (it's the same for any container):
public class SplashScreen extends JWindow {
public SplashScreen() {
BackgroundPanel bp = new BackgroundPanel();
bp.setLayout(new BorderLayout());
getContentPane().add("Center", bp);
}
public class BackgroundPanel
extends Container {
Image background;
public BackgroundPanel() {
URL u = ClassLoader.getSystemResource(
"images/Splash.jpg");
background = Toolkit.getDefaultToolkit().getImage(u);
}
public void paint(Graphics g) {
g.drawImage(background, 0, 0, this);
super.paint(g);
}
public void update(Graphics g) {
paint(g);
}
}