Hello,
I wrote a simple application, it should only display an image.
I my Application I uses the following code
label.setIcon( new ClassResource( "find.png", this ) );
My find.png is located in the the package as the Application class.
After running the application no Image will be displayed, in the logs I found
[u]
INFO: Requested resource [VAADIN/APP/1/find.png]
not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
[/u]
Whats wrong ?
After I added
@Override
public String getRelativeLocation( final ApplicationResource resource) {
try {
Field field = Application.class.getDeclaredField("resourceKeyMap");
field.setAccessible(true);
Map<Application,String> map = (Map<Application, String>) field.get( this );
String key = map.get(resource);
if( key != null ) {
return "app://APP/" + 1 + "/x";
}
} catch (Exception e) {
e.printStackTrace();
}
return super.getRelativeLocation(resource);
}
I my Application everythings works as expected.
I’m not sure whats wrong, do I used the api wrong ?
Best regards,
André