image missing when deploying as a jar


I have created an add on and am testing it now, but noticed that the icons are now missing. I don’t see anything in the forums about this, so I must be doing something wrong.

I’m creating icons like this:

private ThemeResource addIcon = new ThemeResource(“images/icons/add.png”);

but the application where it gets deployed to is not using the same Theme as the add-on, so the url to the icon in the application is:


which is not the same theme as I defined in my add on project.

How do I handle this?



PS. I just noticed similar problem with my styles defined in the add on




OK, after looking into this a bit further, I realized that ThemeResources are meant to be switched depending on the theme chosen, and I’m not going to spend time right now to allow users to change the icon…

So, to anyone reading this thread in the future with a similar problem/question, I did the following:

  1. created a resources folder which I added to the classpath
  2. put my images in that folder
  3. referred to images like this:
Resource addIconResource = new ClassResource("images/icons/add.png", getApplication());