wants more options in choosing the name and type of image



Hi All,
My present java programming practice is to write a program that
specifies a folderlocation/fileName.jpg within the program, such as
"image/cak.jpg" inside the program. Now I use ...

public ShoImage() {
this.setLayout(new BorderLayout());
imagePanel = new JPanel() {

protected void paintComponent(Graphics g) {

super.paintComponent(g);
ImageIcon myImage = new ImageIcon("image/cak.jpg");
g.drawImage(myImage.getImage(), 0, 0, Color.white,
(java.awt.image.ImageObserver) imagePanel);
}
};
this.add(imagePanel, BorderLayout.CENTER);
}

........

I want the user to have more options to choose the name and type of
image .

TIA

bH

.