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

PrintJob cancel issue in JDK 7

XMLWordPrintable

    • 2d
    • x86
    • windows_7

      Java version: through out all JDK 7

      OS: Windows

      Browser: IE


      Facing an issue in Java 1.7 where once login to our application and after selecting a value to print, the print dialog opens. Now when click on cancel instead of OK button, error throws -
       
      Below the code snippet

      Private PrintJob pjb;
      pjb = factory.getPrintJob( frame, orientation );
      pg = pjb.getGraphics();


      Here for all versions of 1.7 Jre would get pg value as "null" due to which error is thrown.

      This issue is not happening in Java 1.6 and 1.5. To fix this, there did has a workaround to check for null condition and returning false in code. After doing this workaround, the issue is resolved.

      if there is any other solution to implement this code apart from going with the workaround.

            psadhukhan Prasanta Sadhukhan
            tyao Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: