posted 20 years ago
I have created an instance of a frame. Inside this frame is a button "Print". If I click on this button, I instantiated an object from the PrintJob class. With this object, I invoked the printDialog() method showing a dialog box. Below is the snippet of the code:
void jButton8_actionPerformed(ActionEvent e) {
PrinterJob job = PrinterJob.getPrinterJob();
PageFormat landscape = job.defaultPage();
landscape.setOrientation(PageFormat.PORTRAIT);
job.setPrintable(new SOSReport(), job.defaultPage());
if(job.printDialog()) { // loads a dialog box
try { job.print(); }
catch(Exception e1) {insert_log(e1.getMessage());}
}
}
When this dialog box appear, I want it to be modal. The frame at the back of this dialog box should be inactivated. Also, I want to remove the minimize button of this dialog box.
How do I do it?
Thanks,
Richard