assetManager - load Image for ImageIcon

I would like to load a Image for a swing component.

assetManager can load jpg or png, but returns a texture, which i cannot use as ImageIcon.

I tried a workaround, but it didn't work.

How should I use the AWTLoader and assetManager to get an awt Image?



Thx

You can create your own AssetLoader that simply returns an AWT image, right?

I tried, but failed  :stuck_out_tongue:



And for png, jpg there exist already an AssetLoader (AWTLoader).

There is no way to get back a image from a Texture, right?

You can convert a jME3 image to an AWT image using the class ImageToAwt in jme3tools. But its not recommended. Instead, you should try to make an AssetLoader that just returns an AWT image, as it will be fastest.