protected void loadImage(String imageName) {
Image image = null;
URL url = cls.getResource(imageName);
if (url != null) {
log.debug(url.toString());
image = Toolkit.getDefaultToolkit().getImage(url);
} else {
try {
if (System.getSecurityManager() != null) {
AccessController.checkPermission(new FilePermission(
imageName, "read"));
}
image = Toolkit.getDefaultToolkit().getImage(imageName);
} catch (AccessControlException ace) {
log.error("Icon " + imageName + " could not be located as a " +
"resource, and the current security manager will not " +
"allow checking for a local file.");
}
}
if (image != null) {
this.setImage(image);
}
}
|