-
Bug
-
Resolution: Fixed
-
P3
-
6
This behavior occurs with the latest mustang build, b79. It does not occur with b66. This occurs on Linux and Solaris platforms.
Clicking on swing components present in a blocked JFrame changes the cursor shown. I've a JFrame on which I have a JButton and JTextField. The frame is blocked by a modal dialog. When I move the mouse over the JTextField, default cursor is shown. When I click on the text field, the cursor changes to text cursor. Even when I move the mouse over the button, the cursor shown is the same. Now, if I click anywhere on the frame outside the text field, the cursor changes to default cursor.
This behavior is not reproducible with awt components.
To reproduce, run the code below:
import javax.swing.*;
import java.awt.FlowLayout;
public class TestCursor {
public static void main(String[] args) {
JFrame f = new JFrame("Frame");
JDialog d = new JDialog(new JFrame(), "Dialog");
d.setModal(true);
d.setSize(100, 100);
d.setLocation(200, 200);
f.setSize(200, 200);
f.getContentPane().setLayout(new FlowLayout());
f.getContentPane().add(new JButton("Button"));
f.getContentPane().add(new JTextField(15));
f.getContentPane().add(new JTextArea(5, 10));
f.setVisible(true);
d.setVisible(true);
}
}
Clicking on swing components present in a blocked JFrame changes the cursor shown. I've a JFrame on which I have a JButton and JTextField. The frame is blocked by a modal dialog. When I move the mouse over the JTextField, default cursor is shown. When I click on the text field, the cursor changes to text cursor. Even when I move the mouse over the button, the cursor shown is the same. Now, if I click anywhere on the frame outside the text field, the cursor changes to default cursor.
This behavior is not reproducible with awt components.
To reproduce, run the code below:
import javax.swing.*;
import java.awt.FlowLayout;
public class TestCursor {
public static void main(String[] args) {
JFrame f = new JFrame("Frame");
JDialog d = new JDialog(new JFrame(), "Dialog");
d.setModal(true);
d.setSize(100, 100);
d.setLocation(200, 200);
f.setSize(200, 200);
f.getContentPane().setLayout(new FlowLayout());
f.getContentPane().add(new JButton("Button"));
f.getContentPane().add(new JTextField(15));
f.getContentPane().add(new JTextArea(5, 10));
f.setVisible(true);
d.setVisible(true);
}
}
- relates to
-
JDK-6242833 Mouse cursor doesn't behave correctly after maximizing on Linux/JDS 3
- Resolved
-
JDK-6478635 Mouse Cusor remains to Textcusor even after the modal dialog is visible.
- Closed