Update PrintHTML.java

Added thrown exception and dispose of  JFrame in order to avoid incorrect Java popup  display/ behavior