JDK-6509330 : ServiceUI.printDialog ignores top margin
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 5.0,6
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-01-03
  • Updated: 2016-04-13
  • Resolved: 2016-04-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 9
9Resolved
Related Reports
Duplicate :  
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_09"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_09-b03)
Java HotSpot(TM) Client VM (build 1.5.0_09-b03, mixed mode)

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

A DESCRIPTION OF THE PROBLEM :
In the printer dialog
PrinterJob.printDialog ( PrintRequestAttributeSet )
or ServiceUI.printDialog
the value of the top margin is ignored if no other margin value is changed.

The reason:
The class sun.print.ServiceDialog is used. In the constructor of the inner class MarginsPanel the JFormattedTextField topMargin gets two listeners but it loses them since a new JFormattedTextField is assigned to topMargin. This happens twice, a second time after the definition of bottomMargin. Without listeners the method updateMargins is not called for topMargin.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Open the printer dialog with
PrinterJob.printDialog ( PrintRequestAttributeSet )
or ServiceUI.printDialog.
Switch to the PageSetupPanel. In the MarginsPanel change only the top margin and press OK. Do not change any other margin value.
The new top margin does not appear in the MediaPrintableArea attribute of the resulting PrintRequestAttributeSet.



REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
The user must change another margin value, too.