Add a picture to a Jpanel

I am trying to add a picture to a jpanel.

such as.

JPanel alpha =new JPanel()

Image img = Toolkit.getDefaultToolkit().getImage("cooltext56657116.gif");

alpha.add (img)

but I get the error that states that there is no add(java.awt.Image)

Is there a way I can add an image to a JPanel using another means,

Without using the paint Method.

all help is appreciated, and thanks in advanced.

[499 byte] By [xpyro_666xa] at [2007-11-27 6:16:49]
# 1
Create a JLabel with an image and add that to the panel.
hwaitea at 2007-7-12 17:28:56 > top of Java-index,Desktop,Core GUI APIs...
# 2
The best solution (the less dirty) is to create a class overriding the method repaint, in this method you draw via drawImage your picture. The constructor of this class will load the wanted picture.
arno_ba at 2007-7-12 17:28:56 > top of Java-index,Desktop,Core GUI APIs...