The list of methods to do ImageIcon Load are organized into topic(s).
ImageIcon
getImageIcon(final Class baseClass, final String image) Create an Icon from a given resource.
if (image == null) {
return null;
final byte[][] buffer = new byte[1][];
try {
InputStream resource = baseClass.getResourceAsStream(image);
if (resource == null) {
return null;
...
ImageIcon
getImageIcon(final String location) Get an image as a resource and create an ImageIcon
ImageIcon icon = null;
URL url = Thread.currentThread().getContextClassLoader().getResource(location);
if (url != null)
icon = new ImageIcon(url);
return (icon);
ImageIcon
getImageIcon(String filename, String description) Keeps a hashmap of SoftReferences to images, hashed by filename, so that the same image icon will be used for multiple versions of the same image.
ResourceBundle bundle = ResourceBundle.getBundle("com.stottlerhenke.simbionic.editor.gui.ImageBundle");
try {
ImageIcon icon = (ImageIcon) bundle.getObject(filename);
if (icon == null)
return new ImageIcon();
return icon;
} catch (Exception e) {
return new ImageIcon();
...
ImageIcon
getImageIcon(String name) Get an ImageIcon.
URL url = getURL(name);
if (url != null) {
return new ImageIcon(url);
return null;
ImageIcon
getImageIcon(String name) Charge une image
Toolkit toolkit = Toolkit.getDefaultToolkit();
URL url;
url = ClassLoader.getSystemResource("org/analyse/core/gui/images/" + name);
if (url == null) {
url = ClassLoader.getSystemResource("org/analyse/core/gui/images/home.png");
ImageIcon icon = new ImageIcon(url);
hashtable.put(name, icon);
...
ImageIcon
getImageIcon(String path) getImageIcon.
try {
Object o = new Object();
Class c = o.getClass();
URL url = c.getResource("/" + path);
return new ImageIcon(url);
} catch (Exception e) {
try {
...