/**
* Creates an ImageIcon from the specified file. The image will
* be preloaded by using MediaTracker to monitor the loading state
* of the image.
* @param filename the name of the file containing the image
* @param description a brief textual description of the image
* @see #ImageIcon(String)
*/
public ImageIcon(String filename, String description) {
image = Toolkit.getDefaultToolkit().getImage(filename);
if (image == null) {
return;
}
this.filename = filename;
this.description = description;
loadImage(image);
}
/**
* Creates an ImageIcon from the specified file. The image will
* be preloaded by using MediaTracker to monitor the loading state
* of the image. The specified String can be a file name or a
* file path. When specifying a path, use the Internet-standard
* forward-slash ("/") as a separator.
* (The string is converted to an URL, so the forward-slash works
* on all systems.)
* For example, specify:
* <pre>
* new ImageIcon("images/myImage.gif") </pre>
* The description is initialized to the <code>filename</code> string.
*
* @param filename a String specifying a filename or path
* @see #getDescription
*/
public ImageIcon (String filename) {
this(filename, filename);
}