JDK-6391547 : REGRESSION: The JTextField's cursor is changed when there is a modal dialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2006-02-28
  • Updated: 2011-01-19
  • Resolved: 2006-04-15
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 b81Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
A DESCRIPTION OF THE REGRESSION :
Windows XP Professional SP1+
JDK: mustang b73

Create a jtextfield on the parent window, when a modal dialog is popuped, moving the mouse onto jtextfield at the background should not cause the cursor to be changed.

REPRODUCIBLE TESTCASE OR STEPS TO REPRODUCE:
package testbug;

import java.awt.Dimension;
import java.awt.FileDialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;

import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JTextField;

public class TestAWTDialog extends JFrame {
    private JMenuBar jMenuBar1 = new JMenuBar();

    private JMenu jMenu1 = new JMenu();

    private JMenuItem jMenuItem1 = new JMenuItem();

    private JMenuItem jMenuItem2 = new JMenuItem();

    private JTextField jTextField1 = new JTextField();

    public TestAWTDialog() {
        try {
            jbInit();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private void jbInit() throws Exception {
        this.setJMenuBar(jMenuBar1);
        this.setDefaultCloseOperation(0);
        this.setSize(new Dimension(400, 300));
        this.setTitle("File->Open->Move your mouse onto TextField");
        jMenu1.setText("File");
        jMenuItem1.setText("Open");
        jMenuItem1.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        jMenuItem1_actionPerformed(e);
                    }
                });
        jMenuItem2.setText("Exit");
        jMenuItem2.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        jMenuItem2_actionPerformed(e);
                    }
                });
        jMenu1.add(jMenuItem1);
        jMenu1.add(jMenuItem2);
        jMenuBar1.add(jMenu1);
        this.getContentPane().add(jTextField1, null);
    }

    private void jMenuItem2_actionPerformed(ActionEvent e) {
        System.exit(0);
    }

    private void jMenuItem1_actionPerformed(ActionEvent e) {
        FileDialog fd = new FileDialog(this);
        fd.setMode(FileDialog.LOAD);
        fd.setTitle("File dialog");
        fd.setVisible(true);
    }
    
    public static void main(String[] argv){
        TestAWTDialog dlg = new TestAWTDialog();
        dlg.setVisible(true);
    }

}


RELEASE LAST WORKED:
5.0 Update 6

RELEASE TEST FAILS:
mustang-beta

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Default cursor
ACTUAL -
The cursor is changed to a "I" while it should be a pointer...

Release Regression From : 5.0u6
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

Comments
EVALUATION We see similar behavior on Linux/Solaris, but it probably shouldn't be considered a regression as we had the same in Tiger.
22-03-2006

EVALUATION This is a regression of the fix for 4080029 integrated into Mustang b38. Prior to that fix all the modal blocked windows on Win32 platform were disabled (::SetEnabled(FALSE)), so cursor didn't change. After the fix all such windows are not disabled, simply all the input events are filtered, so cursor changes.
02-03-2006