United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6735296 Regression: Common print dialog does not show the correct page orientation
JDK-6735296 : Regression: Common print dialog does not show the correct page orientation

Details
Type:
Bug
Submit Date:
2008-08-08
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
client-libs
OS:
windows_xp
Sub-Component:
2d
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
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();
                job.setDialog(JobAttributes.DialogType.COMMON);
                page.setOrientationRequested(PageAttributes.
                                             OrientationRequestedType.LANDSCAPE);
                PrintJob pj = Toolkit.getDefaultToolkit().getPrintJob(f, "Test", job, page);
            }
        });
        f.setLayout(new FlowLayout());
        f.add(b);
        f.setVisible(true);
    }
}
Caused by fix for 6633656.

                                    

Comments
EVALUATION

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

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



Hardware and Software, Engineered to Work Together