How do I display an image in an APPLICATION

I have the following code and I want to display an image. I figured that the easiest way to display an image was via a JLabel.

import javax.swing.*;

import java.awt.*;

publicclass NewMain{

publicstaticvoid main(String[] args){

JFrame win =new JFrame("TestApp");

win.setDefaultCloseOperation(win.EXIT_ON_CLOSE);

win.setBounds(0,0,200,200);

ImageIcon icon =new ImageIcon("ca.bmp");

JLabel label =new JLabel("",icon,JLabel.CENTER);

win.add(label);

win.setVisible(true);

}

}

What am I doing wrong. I have the cd.bmp file in the source directory but I just get an empty frame when I run the program...

PS: I get a lot of hate messages in other forums. I am BRAND new to programming anything (especially OOP). I realize I suck at this but that is why I am trying to learn.

[1414 byte] By [Galm_1a] at [2007-10-3 12:01:43]
# 1
You need to become familar with Sun's tutorials, like this one about labels: http://java.sun.com/docs/books/tutorial/uiswing/components/label.htmlIt has an example and code for what you want to do.
ChuckBinga at 2007-7-15 14:38:22 > top of Java-index,Java Essentials,New To Java...
# 2
Convert your image to a .gif and useImageIcon icon = new ImageIcon("ca.gif");
pbrockway2a at 2007-7-15 14:38:22 > top of Java-index,Java Essentials,New To Java...