This should help you out, I myself had the same problem.
public void createPanel()
{
JLabel lbTest ;
pMain.setBackground(color2);
pMain.setLayout(null);
ImageIcon icon = null;
try
{
icon = new ImageIcon(new URL (MyApplet.getCodebase() +"pictures/sun.JPG"));
}
catch(MalformedURLException mue){}
lbTest = new JLabel("THIS IS MY PIC", icon, JLabel.CENTER);
lbTest.setVerticalTextPosition(JLabel.BOTTOM);
lbTest.setHorizontalTextPosition(JLabel.CENTER);
lbTest.setBackground(color1);
lbTest.setBounds(new Rectangle (30, 20, 740,400));
pMain.add(lbTest);
}
And for detail, here is a good link for swing components:
http://java.sun.com/docs/books/tutorial/uiswing/components/components.html