Dispose Jframe on Printer Error

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