public class Image extends JFrame {
JPanel jpanel;
JLabel label;
ImageIcon icon;
public Image(){
icon = new ImageIcon("pond.png");
label = new JLabel(icon);
label.setLayout(null); label.setBounds(0,0,icon.getIconWidth(),icon.getIconHeight());
jpanel = new JPanel();
jpanel.setLayout(null);
jpanel.setBackground(Color.GRAY);
jpanel.add(label); jpanel.setBounds(0,0,icon.getIconWidth(),icon.getIconHeight());
this.setTitle("test");
this.add(jpanel);
this.setVisible(true);
this.pack(); this.setBounds(new Rectangle(10,10,icon.getIconWidth(),icon.getIconHeight()));
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String [] args){
new Image();
}