JDK-6985673 : MToolkit : closing a Modal dialog keeps top-level window uneditable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u21-rev
  • Priority: P2
  • Status: Closed
  • Resolution: Won't Fix
  • OS: solaris_10
  • CPU: sparc
  • Submitted: 2010-09-17
  • Updated: 2011-08-18
  • Resolved: 2011-08-18
Related Reports
Relates :  
Description
Compile and execute the following testcase with MToolkit.

1- Type test in the 2 TextFields of the top window
2- Click on the "Open JDialog" button
3- Close the "Modal JDialog" window
4- Try to type text in the 2 TextFields. The 2 TextFields are no more editable.

In addition, when the Modal window is opened, the mouse cursor is a text cursor in the TextFields instead of an arrow as in XToolkit.

% cat Test.java
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;

public class Test {

    public static void main(String[] args) {

        final Frame f = new Frame("Top Window");
        f.setLayout(new BorderLayout());
        f.setBounds(0, 0, 500, 110);
        f.addWindowListener(new WindowAdapter() {
            public void windowClosing(WindowEvent ev) {
                System.exit(0);
            }
        });

        JTextField text = new JTextField();
        JTextField text1 = new JTextField();
        JButton b = new JButton("Open JDialog");
        JPanel topPanel = new JPanel();
        topPanel.setLayout(new BorderLayout());
        topPanel.add( text, BorderLayout.NORTH );
        topPanel.add( text1, BorderLayout.CENTER );
        topPanel.add( b, BorderLayout.SOUTH );
        f.add(topPanel, BorderLayout.NORTH);
        f.setVisible(true);

        b.addActionListener( new ActionListener(){
                public void actionPerformed(ActionEvent e)
                {
                JDialog jd = new JDialog( f, "Modal JDialog");
                JButton but = new JButton("JButton");
                jd.setMinimumSize( new Dimension ( 200,100 ) );
                jd.setPreferredSize( new Dimension (200,100 ) );
                jd.setModal(true);
                jd.setLocation(500,100);
                jd.setLayout(new BorderLayout());
                jd.getContentPane().setLayout(new BorderLayout());
                jd.getContentPane().add( but);
                jd.setVisible(true);
                jd.pack();
                jd.setMinimumSize(jd.getPreferredSize());
                }
        });
    }
}

Comments
EVALUATION This problem is more on the motif side on solaris. we have done evaluation on jdk side and there is no way to fix this without causing further problems. Also, since Mtoolkit is not supported on 7 this bug is marked as 7-na.
18-08-2011