Search code examples
codenameone

In a codenameone project - How can I get images programmatically from the project resources folder?


CodenameOne changed the project structure after the maven dependence manager passed to be used as the new standard for dependence management.

Now exists a new folder called resources at the same level as the java folder. (in project structure)
I put my images inside the /resources/images.

How can I get these images programmatically? I tried some java common approaches without success.


Solution

  • Don't put the images in a folder under resources. Put them directly in common/src/main/resources then access them using /imagename.png as you always have.