JDK-4759934 : windows activation problem
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_nt
  • CPU: generic
  • Submitted: 2002-10-08
  • Updated: 2003-04-02
  • Resolved: 2003-04-02
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.
Other
5.0 tigerFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Try on windows and solaris.

Install Java Web Start 1.2 - comes with J2SE 1.4.1

Start Java Web Start application manager.

click file->prefereces, which brings up the Java Web Start prefernces dialog 
(non-modal).

choose root certificates tab.

click import, which brings up a JFileChooser, which parents to the Certificate 
Panel, which is in the preferences dialog.

now click canel.

1.  On Solaris, the preferences dialog becomes the active dialog again.

2.  On Windows, the java web start application mananager becomes the active 
dialog.

Why is there a difference of behaviour?  the code is the same on both cases.  
Shouldn't the preferences dialog becomes active in windows case too?

If I change the preferences dialog to modal instead, in both cases, the 
preferences dialog becomes active again, which is what I expect.



Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger FIXED IN: tiger INTEGRATED IN: tiger tiger-b04
24-08-2004

EVALUATION This is happening because JFileChooser parents the JDialog to the nearest frame ancestor vs nearest frameOR dialog ancestor. Most likely JOptionPane and JColorChooser will need to change to. ###@###.### 2002-10-08 Name: apR10133 Date: 10/12/2002 JOptionPane works properly and uses correct ancestor for its dialogs. JFileChooser and JColorChooser needs changes mentioned above. ###@###.### ======================================================================
24-08-2004

SUGGESTED FIX Name: apR10133 Date: 10/12/2002 ------- JFileChooser.java ------- *** /tmp/sccs.xXaG4F Sat Oct 12 21:22:53 2002 --- JFileChooser.java Sat Oct 12 21:22:40 2002 *************** *** 23,28 **** --- 23,30 ---- import java.awt.Component; import java.awt.Container; import java.awt.BorderLayout; + import java.awt.Window; + import java.awt.Dialog; import java.awt.Frame; import java.awt.GraphicsEnvironment; import java.awt.HeadlessException; *************** *** 725,737 **** * @since 1.4 */ protected JDialog createDialog(Component parent) throws HeadlessException { ! Frame frame = parent instanceof Frame ? (Frame) parent ! : (Frame)SwingUtilities.getAncestorOfClass(Frame.class, parent); String title = getUI().getDialogTitle(this); ! JDialog dialog = new JDialog(frame, title, true); ! Container contentPane = dialog.getContentPane(); contentPane.setLayout(new BorderLayout()); contentPane.add(this, BorderLayout.CENTER); --- 727,743 ---- * @since 1.4 */ protected JDialog createDialog(Component parent) throws HeadlessException { ! Window window = JOptionPane.getWindowForComponent(parent); String title = getUI().getDialogTitle(this); ! JDialog dialog; ! if (window instanceof Frame) { ! dialog = new JDialog((Frame)window, title, true); ! } else { ! dialog = new JDialog((Dialog)window, title, true); ! } ! Container contentPane = dialog.getContentPane(); contentPane.setLayout(new BorderLayout()); contentPane.add(this, BorderLayout.CENTER); ------- JColorChooser.java ------- *** /tmp/sccs.UMaaG2 Sat Oct 12 21:35:34 2002 --- JColorChooser.java Sat Oct 12 21:34:42 2002 *************** *** 151,158 **** JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener) throws HeadlessException { ! return new ColorChooserDialog(c, title, modal, chooserPane, ! okListener, cancelListener); } /** --- 151,166 ---- JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener) throws HeadlessException { ! Window window = JOptionPane.getWindowForComponent(c); ! ColorChooserDialog dialog; ! if (window instanceof Frame) { ! dialog = new ColorChooserDialog((Frame)window, title, modal, c, chooserPane, ! okListener, cancelListener); ! } else { ! dialog = new ColorChooserDialog((Dialog)window, title, modal, c, chooserPane, ! okListener, cancelListener); ! } ! return dialog; } /** *************** *** 578,588 **** private Color initialColor; private JColorChooser chooserPane; ! public ColorChooserDialog(Component c, String title, boolean modal, ! JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener) throws HeadlessException { ! super(JOptionPane.getFrameForComponent(c), title, modal); //setResizable(false); this.chooserPane = chooserPane; --- 586,609 ---- private Color initialColor; private JColorChooser chooserPane; ! public ColorChooserDialog(Frame owner, String title, boolean modal, ! Component c, JColorChooser chooserPane, ActionListener okListener, ActionListener cancelListener) throws HeadlessException { ! super(owner, title, modal); ! initColorChooserDialog(c, chooserPane, okListener, cancelListener); ! } ! ! public ColorChooserDialog(Dialog owner, String title, boolean modal, ! Component c, JColorChooser chooserPane, ! ActionListener okListener, ActionListener cancelListener) ! throws HeadlessException { ! super(owner, title, modal); ! initColorChooserDialog(c, chooserPane, okListener, cancelListener); ! } ! ! protected void initColorChooserDialog(Component c, JColorChooser chooserPane, ! ActionListener okListener, ActionListener cancelListener) { //setResizable(false); this.chooserPane = chooserPane; ###@###.### ======================================================================
24-08-2004