JDK-4282540 : win32: setCursor not working on parent when parent shows a Modal dialog
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.3.0
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1999-10-19
  • Updated: 2000-07-19
  • Resolved: 2000-07-19
Description

Name: skT88420			Date: 10/19/99


run the following code and you will see that before
and after the modal dialog shows the cursor correctly
shows as the wait cursor. but while the dialog is
showing the parent cursor changes to the default cursor?
This does not occur on Solaris - only on NT.

final JFrame frame      = new JFrame("Cursor test");
Container contentPane   = frame.getContentPane();
JButton showModalDlgBtn = new JButton("Show modal dlg");
contentPane.setLayout(new FlowLayout());
contentPane.add(showModalDlgBtn);

showModalDlgBtn.addActionListener(new ActionListener() {
	public void actionPerformed(ActionEvent e) {
		JDialog dlg = new JDialog(frame,"Dialog",true);
		dlg.getContentPane().add(new JLabel("Parent frame should show busy cusor!"));
		dlg.pack();
		dlg.show();
	}
});

frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
frame.setSize(100,100);
frame.show();
(Review ID: 96716) 
======================================================================

Comments
WORK AROUND Name: skT88420 Date: 10/19/99 None that I know of. ======================================================================
11-06-2004

EVALUATION This bug is reproducible on NT running the latest 1.3 build. Since AWT implements all cursor mgt, this bug belongs to them. amy.fowler@Eng 2000-01-14 This is a tough situation and I'm not sure how or if we can fix this. To show a modal dialog, we have to begin by disabling every Window in the application. We need to do this right away because if showing the modal Dialog takes a long time, then the user might click a button, for example, to try to show the Dialog again. This gets us into a whole series of other problems. Now, recall that a disabled Component does *not* affect the cursor. So if all the Windows in the application are disabled, it makes perfect sense that the user should see the default cursor. Maybe we could fix this by adding an API that allows you to set the cursor system-wide, without regard to the enabled state of various Components. david.mendenhall@eng 2000-01-14 We will look into solving this issue for merlin. lara.bunni@Eng 2000-01-14 The behavior on both platforms (Solaris and Win32) is consistent with that of native applications on the respective platforms. On win32 when a modal dialog is displayed the cursor is restored to the system cursor, but when the parent window is attempted to be focussed on by the end user the system beep occurs. I argue that the behavior is appropriate to each platform. richard.ray@eng 2000-07-19
19-07-2000