REGRESSION: getPrintService() return wrong printer sel. in pageDialog

XMLWordPrintable

    • 2d
    • b43
    • x86
    • windows_xp

      FULL PRODUCT VERSION :
      java version "1.5.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
      Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows XP [Version 5.1.2600]

      A DESCRIPTION OF THE PROBLEM :
      Calling printerJob.pageDialog() brings up the native page setup dialog. On Windows this includes a "Printer..." button which lets you select the printer. But whereas printerJob.getPrintService().getName() used to return the name of the selected printer, now it just returns the name of the default printer. There seems to no longer be a way to find out the name of the printer selected in the native page setup dialog or therefore make that be the name of the selected printer when you bring up the print dialog.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1) Compile and run the program below under JDK 1.4.2 and JDK 1.5.0 on Windows.
      2) Click on "Printer..."
      3) Select a non-default printer.
      4) Note printed line.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Should give name of selected printer
      ACTUAL -
      Gives name of default printer

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.awt.print.*;

      public class Test {
         static public void main(String args[]) {
            PrinterJob pj = PrinterJob.getPrinterJob();
            PageFormat pf = pj.pageDialog(new PageFormat());
            System.out.println(pj.getPrintService().getName());
         }
      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Revert to JDK 1.4.2

      Release Regression From : 1.4.2_05
      The above release value was the last known release where this
      bug was known to work. Since then there has been a regression.
      ###@###.### 10/18/04 11:48 GMT

            Assignee:
            Jennifer Godinez (Inactive)
            Reporter:
            Jitender S (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: