Class javax/swing/Icon violates loader constraints

I've got a ConfigurationComponent for my Plugin that extends ApplicationComponent, Configurable, JDOMExternalizable. I want an Icon in IntellJ's settings. I used the code I found in the sources for the "Google Web Toolkit" (see below).

public class CsPluginConfigurationComponent implements ApplicationComponent, Configurable, JDOMExternalizable {
public static Icon LARGE_ICON = IconLoader.getIcon("/icons/contentserver.png");



public Icon getIcon() {
return LARGE_ICON;
}


}

Unfortunately this leads to a java.lang.LinkageError with the reason "Class javax/swing/Icon violates loader constraints". I know I can avoid the exception if I don't put the Icon in a static variable, but load it every time "getIcon" is called. The question is: Why does it work for "Google Web Toolkit"? Is there something I'm missing?

Any hints will be appreciated

Kai

Please sign in to leave a comment.