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

PrinterJob.printDialog() does not support multi-mon, always displayed on primary

XMLWordPrintable

    • 2d
    • generic
    • generic

        PrintDialog shown using PrinterJob.printDialog(attr set) does not support multi-monitor setup. When this API is invoked, the print dialog is always displayed on the default screen device regardless of where the application is running.

        JTable printing internally uses PrinterJob and hence print dialog always appears on primary screen regardless of where the jtable is shown. This is incorrect.

        When I looked at it more closely, this method uses ServiceDialog class for creating the dialog and that indeed supports passing a GC in which we would like to have the dialog. But printer job always uses the GraphicsConfig of the default screen device.

        This is noticed on all platforms since 1.4, on a multi-monitor setup. I tested this with Solaris9, WinXP. This is well noticed on a solaris system having a multi-screen setup with 2 independent monitors.

        I have attached a sample test. Execute the sample test on a multi-mon setup. You would see a frame on each of the monitor. Click the button on the frame displayed in the non-default monitor. I would expect the print dialog to be displayed in the same screen where the frame is located. But it gets displayed on the primary screen.
        --------------------------------------------------------------------------------

        When there are no print services available, calling PrinterJob.printDialog(attr) shows a message dialog 'No PrintService Found'. This dialog is shown always on the primary monitor and not on the monitor where active window is located. So the GC obtained from the active window must be passed to ServiceDialog.showNoPrintService() method as well.
        ###@###.### 10/12/04 06:03 GMT

              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: