import javax.swing.*;
public class trial extends javax.swing.JFrame{
public trial() {
a = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
a.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Sunset.jpg"));
add(a);
pack();
}
public static void main(String args[]){
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new trial().setVisible(true);
}
});
}
private javax.swing.JLabel a;
}
try this out.......this would add the image to yr frame...
you can look at group layout if u wanna set the position of the image and size