diff options
author | Andy Clement <aclement@pivotal.io> | 2019-02-08 15:13:07 -0800 |
---|---|---|
committer | Andy Clement <aclement@pivotal.io> | 2019-02-08 15:13:07 -0800 |
commit | c89830fe880f329b6289be06314684edc094012c (patch) | |
tree | 63dbaaa792ebd06d74639fc6b8be16c1af3f0e05 /ajde | |
parent | ce1533d8493277d1111005e890f076ef90b32eab (diff) | |
download | aspectj-c89830fe880f329b6289be06314684edc094012c.tar.gz aspectj-c89830fe880f329b6289be06314684edc094012c.zip |
tidyup
Diffstat (limited to 'ajde')
-rw-r--r-- | ajde/src/main/java/org/aspectj/ajde/IconRegistry.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java b/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java index 4cdec89f2..c5a2202ec 100644 --- a/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java +++ b/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java @@ -14,6 +14,8 @@ package org.aspectj.ajde; +import java.net.URL; + import javax.swing.*; import org.aspectj.ajde.ui.*; @@ -149,10 +151,16 @@ public class IconRegistry extends AbstractIconRegistry { } protected AbstractIcon createIcon(String path) { - return new AbstractIcon(new ImageIcon(ClassLoader.getSystemResource(path))); + URL resource = IconRegistry.class.getClassLoader().getResource(path); + if (resource == null) { + throw new IllegalStateException("Unable to find icon resource: "+path); + } + return new AbstractIcon(new ImageIcon(resource)); +// return new AbstractIcon(new ImageIcon(ClassLoader.getSystemResource(path))); } protected Icon makeIcon(String iconPath) { - return new ImageIcon(ClassLoader.getSystemResource(RESOURCE_PATH + iconPath)); + return new ImageIcon(IconRegistry.class.getClassLoader().getResource(RESOURCE_PATH + iconPath)); +// return new ImageIcon(ClassLoader.getSystemResource(RESOURCE_PATH + iconPath)); } } |