Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6390638

REG: Printing without a printable does not throw a PrintException since Tiger

XMLWordPrintable

    • 2d
    • generic
    • generic

      Calling PrinterJob.print() without setting a valid printable throws exception on 1.4.2 on Solaris and win32 saying 'no page or printable exists'. But the same application does not throw any exception on Tiger/Mustang and proceeds fine. Although this is considered to be an user error, it would be good to retain 1.4.2 behavior on upcoming releases where we notify the application that there are no pages to print.

      Here is the exception thrown on 1.4.2:
      java.awt.print.PrinterException: No page or printable exists.
      at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:1370)
      at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1065)
      at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:966)
      at FrameDisposeTest.main(FrameDisposeTest.java:16)

      This is reproducible on Mustang as well as Tiger, on Win32 as well as Solaris.

      Run the attached test and click 'OK' on the print dialog. If you don't see any exception, the bug is reproduced.

            jgodinez Jennifer Godinez (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: