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

Printing from Java Applet fails in JRE 142_04 on Solaris/Netscape

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.4.2_04
    • deploy
    • None
    • generic
    • solaris_9

      From an Applet, trying to do a print using PrintJob.getGraphics() returns 'null'. This happens in Solaris and not in Windows. The same code works fine when running as Application on Solaris.

      Code snippet:
        //Inside an action handler of a Frame created from Applet
        PrintJob pj = getToolkit().getPrintJob(this, "Test Print", null);
        if(pj == null) return;
        Graphics g = pj.getGraphics(); // <== NULL

      Testcase is in the attachment of this bug. Open the demoDefault.html in Netscape browser on Solaris. Click on the Print button from the Frame, which brings up 'Confirmation Needed - Print' dialog (for the 1st time). Click the Yes button to continue, which brings up the 'Print' dialog. Click the OK button to print. Open the Java Console and see java.lang.NullPointerException being thrown.

            sthilagasunw Sathianantha Thilagar (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: