JDK-8203796 : Define API to support specifying ownership of print dialogs
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 11
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-05-24
  • Updated: 2019-06-26
  • Resolved: 2018-06-06
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11
11 b18Fixed
Related Reports
Blocks :  
CSR :  
Description
The Page Setup and Print Dialogs used by Java 2D printing,
i.e. java.awt.print.PrinterJob, are created by the printing
implementation. Thus the application cannot specify an owner
window. The implementation tries to find a suitable window to
act as the owner, so that the dialog can be kept on top of that
window rather than hidden. But if the application could specify this directly it may make for a better experience.
And what if the window is not an AWT window, but say, a JavaFX window ? A way to specify a non-AWT owner might be useful.
Also the application might prefer that it be on top of all windows,
ie. using the java.awt.Window.setAlwaysOnTop(true) functionality.
This might be needed for the case where the non-AWT window owner support is not possible.

With such API we can remove JavaFX's dependency on JDK internal access to this dialog ownership behaviour as tracked by
https://bugs.openjdk.java.net/browse/JDK-8195808

One way to do this is to add a new DialogOwner printing attribute.
The application can include this in the attribute set parameter to the dialog methods.