How can I check if the user clicked cancel in my P… How can I check if the user clicked cancel in my PrinterJob printing dialog?

Sachin Patil

printerJob.printDialog() method which pops up the print options dialog returns boolean true or false.

If user clicks cancel button it returns false and you can trap it by declaring and checking a boolean variable. for example:

 boolean doPrint =  printerJob.printDialog();
   if (doPrint)
          printerJob.print();
   else
         foo();
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact