Update PrintHTML.java

Added thrown exception and dispose of  JFrame in order to avoid incorrect Java popup  display/ behavior
For consistency, you should use the tab character for indents rather than 3 spaces.