Skip to content
Advertisement

Codename One images not loading

The image(s) is in the “src” folder. Everything was working fine, until this morning I keep getting a black screen when I run the simulator with “java.lang.IllegalArgumentException: stream == null!”

JavaScript

Advertisement

Answer

You can’t let the exception bubble since the method is a callback and this is a checked exception. But add Log.e(e) into the catch block. NEVER do a blank catch block.

If you use Maven the image needs to be in the resources directory not in the src directory. Like you see here in the KitchenSink. Under common/src/main/resources.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement