try
{
final ResourceManager resourceManager = new ResourceManager();
resourceManager.registerDefaults();
final Resource resource = resourceManager.createDirectly(url, Image.class);
this.url = url;
this.resourceKey = resource.getSource();
this.image = (Image) resource.getResource();
}
catch (ResourceException e)
{
throw new IOException("The image could not be loaded.");
}