how to display an image on a JFrame ?

i’m new here… can anyone show me how the simplest way to show image on JFrame ?

Here’s a simple shitty way:


JFrame frame = new JFrame();
ImageIcon icon = new ImageIcon("image.png");
frame.add(new JLabel(icon));
frame.pack();
frame.setVisible(true);

Here’s another way: http://www.java-gaming.org/topics/loading-a-bufferedimage/30470/msg/282671/view.html#msg282671