How to catch the following exception that is printed to the error console when trying to load a corrupted PNG file:
sun.awt.image.PNGImageDecoder$PNGException: i
This Exception is thrown from a separate thread, not the main thread. Actually your application execution completes successfully.