Java Solaris Communities Sun Store Join SDN My Profile Why Join?
 
Bug Database
Bug Detail
Quick Lists
Top 25 Bugs
Top 25 RFE's
Recently Closed Bugs
Printable Page Printable Page


Bug Database
Bug ID: 4273333
Votes 4
Synopsis RFE: Let PrinterJob.printDialog dialog box be optionally modal
Category java:classes_awt
Reported Against 1.2.2 , 1.3.1
Release Fixed 1.3.1_03
State 10-Fix Delivered, request for enhancement
Priority: 4-Low
Related Bugs 4616183 , 4797151 , 5084278 , 4785920
Submit Date 20-SEP-1999
Description




The dialog box shown by PrinterJob.printDialog is not modal and it should be. There is no option to make it modal even though most, if not all, applications will need it to be modal. Users with little knowledge may lose the dialog behind the browser window and not know how to get it back again.

public class Applet extends javax.swing.JApplet
    implements java.awt.print.Printable
{
    public void start()
    {
        java.awt.print.PrinterJob pjob = 
            java.awt.print.PrinterJob.getPrinterJob();
        pjob.setPrintable(this);
        if (pjob.printDialog())  // not modal, but needs to be
        {
            try
            {
                pjob.print();
            }
            catch (java.awt.print.PrinterException e)
            {
            }
        }
    }
    
    public int print(java.awt.Graphics g,
        java.awt.print.PageFormat pf,int index)
    {
        if (index <= 0)
        {
            return java.awt.print.Printable.PAGE_EXISTS;
        }
        return java.awt.print.Printable.NO_SUCH_PAGE;
    }
}
(Review ID: 93979) 
======================================================================

Failed in JDK1.4.1, JDK1.4.1_01 but it was fixed in merlin-beta so should be fixed in Hopper also.


 xxxxx@xxxxx  2002-12-19
Work Around
N/A
Evaluation
I believe this is because we set the hWndOwner field to NULL because
we don't have any easy way to make the association, and the Java API does not
require a window to be associated with the dialog.

implementing this seems to need new API
Perhaps we could do this with a new Java (cross-platform) dialog or with the native dialog with a new API which allows a parent Window to be supplied which
is taken to be the owner window.

Incidentally the pageDialog has exactly the same issue as printDialog

 xxxxx@xxxxx  1999-09-20
========================

Fix was putback in 1.3.1_03 and Merlin-beta. But the bug is still  reproducible in hopper and mantis.

Regression is caused in Hopper. 

The Suggested fix exists in Hopper . Even then its failing.

Still needs to be investigated .
 xxxxx@xxxxx  2002-11-25


This bug started to occur in 1.4.1 beta b06 but we have not made any change in dialog. Looks like AWT made some changes on focus - passing to AWT for investigation.

 xxxxx@xxxxx  2002-11-26 

Since it sounds like there may have been a regression of this fix in 1.4.1, 
I filed a new bug: 4785920.  

 xxxxx@xxxxx  2002-11-27
Comments
  
  Include a link with my name & email   

Submitted On 07-DEC-2000
kledreze1
I also think this dialog should be made modal as other Dialog are.
 


Submitted On 18-APR-2002
potel
As per your comment in the evaluation, you need to extend the API to let us pass the parent frame into the 
pageDialog and printDialog modal dialogs.  Without this, if you bring up a pageDialog (or printDialog), then 
cover it with a different application window, and then use bring your Java application back to the front 
using the task bar, the pageDialog (or printDialog) remains hidden, and the user is stuck until they uncover 
it.  Even if the main Java window isn't hidden by the other application window, they can't click on it to make 
it active.   The problem was not fixed with new cross-platform dialogs.


Submitted On 24-APR-2002
ODonovanCi
Why is this bug marked fixed?


Submitted On 21-MAY-2002
jk14
Redraw problems with Swing GUIs using PrinterJob.printDialog
are in another report with Bug ID: 450758


Submitted On 30-SEP-2002
killeroonie
This is still not implemented as of JDK1.4.1-b21.

The question remains, WHY is this marked closed?

Btw, there is NO bug in your database with an ID = 450758

SUN, PLEASE, be more careful in your closing of bugs that 
aren't fixed and  RFE's that haven't been implemented, and 
PLEASE use more care in entering information into your bug 
database. It's a crucial resource, and bad data doesn't help 
anyone solve problems.


Submitted On 16-MAY-2003
clintLark
Again, the question - WHY IS THIS MARKED FIXED?


Submitted On 18-JUL-2006
Alex_Matute
what's the fix/workaround for this? anybody?



PLEASE NOTE: JDK6 is formerly known as Project Mustang