/**
* This is a utility method to help in loading icon images. It takes the
* name of a resource file associated with the current object's class file
* and loads an image object from that file. Typically images will be GIFs.
*
* @param resourceName A pathname relative to the directory holding the
* class file of the current class. For example, "wombat.gif".
* @return an image object or null if the resource is not found or the
* resource could not be loaded as an Image
*/
public Image loadImage(final String resourceName) {
try {
final URL url = getClass().getResource(resourceName);
if (url != null) {
final ImageProducer ip = (ImageProducer) url.getContent();
if (ip != null) {
return Toolkit.getDefaultToolkit().createImage(ip);
}
}
} catch (final Exception ignored) {
}
return null;
}
SimpleBeanInfo.java 文件源码
java
阅读 31
收藏 0
点赞 0
评论 0
项目:openjdk9
作者:
评论列表
文章目录