JDK-6735296 : Regression: Common print dialog does not show the correct page orientation
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2008-08-08
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
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.
6u14Fixed 7 b54Fixed
This is reproducible with 6u10 b28 on Windows, but not reproducible with jdk6 b104. Print dialog shows the Orientation in Page Setup as 'Portrait' inspite of setting it to Landscape in PageAttributes. Also, the options 'Reverse Portrait' and 'Reverse Landscape' are shown disabled with jdk6 b104, but they are shown enabled with 6u10 b28.

To reproduce, run the below code, click on the 'Print' button and select the 'Page Setup' tab in Print dialog.

import java.awt.*;
import java.awt.event.*;

public class PrintTest {
    private static Frame f;
    public static void main(String[] args) {
        f = new Frame();
        f.setSize(100, 100);
        Button b = new Button("Print");
        b.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent event) {
                JobAttributes job = new JobAttributes();
                PageAttributes page = new PageAttributes();
                PrintJob pj = Toolkit.getDefaultToolkit().getPrintJob(f, "Test", job, page);
        f.setLayout(new FlowLayout());
Caused by fix for 6633656.

EVALUATION Regression caused by 6633656 fix. Fix is to return code prior to fixing 6633656 and just check for null return from getDefaultAttributeValue.

EVALUATION The problem is introduced somewhere between 6u10-b12 and 6u10-b24 (I don't have other 6u10 build locally).