-
Bug
-
Resolution: Fixed
-
P4
-
1.2.1
-
kestrel
-
x86
-
windows_95
Name: rlT66838 Date: 06/09/99
1. While printing a screen using Java2D print(), I intend to
cancel the Printing by using PrinterJob.cancel().
But, the Printing job is not being cancelled.
2. Relevant Portion of SOURCE-CODE :
PrinterJob job;
job = PrinterJob.getPrinterJob();
job.setPrintable(this);
pf = job.defaultPage();
pf.setOrientation(PageFormat.LANDSCAPE);
if (job.printDialog())
{
try{
job.print();
}
catch (Exception e)
{
JOptionPane.showMessageDialog(this,"exception occured while printing......");
}
}
public int print(Graphics g, PageFormat pf, int pageIndex) throws PrinterException
{
if (pageIndex >= 1)
return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D) g;
g2.translate(pf.getImageableX()-55, pf.getImageableY()-10);
getContentPane().paint(g2);
return Printable.PAGE_EXISTS;
}
//In the Event-Handler of Cancel Button, I am using :
job.cancel();
5. Output of "java -version" command :
java version "1.2.1"
Classic VM(build JDK-1.2.1-A, native threads)
Output of "java -fullversion" command :
JAVA.EXE full version "JDK1.2.1-A"
(Review ID: 84115)
======================================================================