JDK-5109459 : TableDemo-Print message dialog is displayed in the wrong screen, on multi-mon
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-09-30
  • Updated: 2006-12-06
  • Resolved: 2004-10-16
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 6
6 b09Fixed
Related Reports
Relates :  
Description
Where: SwingSet2 - JTable Demo
feature: Printing
Config: Multi-Screen setup 
Platform: All

Run SwingSet2. Using 'multiscreen' menu, create a new instance on the secondary monitor. Goto JTableDemo and click the 'print' button. A print dialog comes up (print dialog still appears on the primary screen though you are interacting with a control on the sec monitor. A separate bug has been filed against PrinterJob: 5109347). Click 'print' on the print dialog. After the table is printed, an information dialog appears to inform the user that the printing operation has completed. This dialog appears on the primary monitor instead of sec. monitor. This is incorrect. 

This is reproducible on Tiger as well as Mustang. This is reproducible on all platforms. 

To reproduce the bug, run the swingset2 as mentioned above.

When I looked at the code more closely - TableDemo.java, the call to JOptionPane.showMessageDialog() passes 'this' for the parent component argument. I changed it to 'getDemoPanel()' and it worked fine. I am not sure whether this is the right fix.

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
01-10-2004

EVALUATION Submitter's fix is valid, however I will take a slightly modified approach. The problem here was that "this" represents an Applet which was never part of the containment hierarchy. As a result, the dialog was being positioned with respect to the shared hidden frame. I've instead changed "this" to tableView.getParent() which is the Viewport and the component that is used when displaying table printing's status dialog. ###@###.### 2004-09-30
30-09-2004