Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I check if an image in a ImagePanel exist?

Status
Not open for further replies.

Petal

Programmer
Jun 8, 2001
56
NO
How can I check if the Image I would like to load in the ImagePanel exist?

I am using this code to show a image in the panel after selecting an item from a multilist.

try {
imagePanel1.setImageURL(new java.net.URL(" 0)+".jpg"));

}
catch (java.net.MalformedURLException error) { }
catch(java.beans.PropertyVetoException e) { }
try {
imagePanel1.setStyle(symantec.itools.awt.ImagePanel.IMAGE_CENTERED);
}
catch(java.beans.PropertyVetoException e) { }
imagePanel1.setLayout(null);

If the image don't exist the imagePanel is blank. I would like to give the user the opportunity to add a picture if the image don't exist, but then i need to know wethever the image exist og not.

Jørn Arild Andenæs
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top