From c89830fe880f329b6289be06314684edc094012c Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Fri, 8 Feb 2019 15:13:07 -0800 Subject: tidyup --- ajde/src/main/java/org/aspectj/ajde/IconRegistry.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'ajde') 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)); } } -- cgit v1.2.3