-
Bug
-
Resolution: Fixed
-
P3
-
7
-
b43
-
x86
-
windows_7
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2217131 | 7u6 | Alexandr Scherbatiy | P3 | Closed | Fixed | b17 |
FULL PRODUCT VERSION :
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
When double-clicking with the mouse in a java.awt.TextField the caret is set to the beginning. One would expect the selection of the word lying under the mouse cursor. Works fine with javax.swing.JTextField though.
REGRESSION. Last worked in version 6u26
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
In the executable test case below, double-click anywhere in the TextField.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Word under the mouse cursor is selected.
ACTUAL -
Caret was set to the beginning.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.TextField;
public class TextFieldTest {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
final Frame frame = new Frame();
frame.add(new TextField("Lorem ipsum."));
frame.pack();
frame.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
java version "1.7.0"
Java(TM) SE Runtime Environment (build 1.7.0-b147)
Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]
A DESCRIPTION OF THE PROBLEM :
When double-clicking with the mouse in a java.awt.TextField the caret is set to the beginning. One would expect the selection of the word lying under the mouse cursor. Works fine with javax.swing.JTextField though.
REGRESSION. Last worked in version 6u26
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
In the executable test case below, double-click anywhere in the TextField.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Word under the mouse cursor is selected.
ACTUAL -
Caret was set to the beginning.
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import java.awt.EventQueue;
import java.awt.Frame;
import java.awt.TextField;
public class TextFieldTest {
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
final Frame frame = new Frame();
frame.add(new TextField("Lorem ipsum."));
frame.pack();
frame.setVisible(true);
}
});
}
}
---------- END SOURCE ----------
- backported by
-
JDK-2217131 Double-click in TextField sets caret to the beginning
-
- Closed
-
- relates to
-
JDK-8149636 TextField flicker & over scroll when selection scrolls beyond the bounds of TextField.
-
- Resolved
-
-
JDK-8036110 In TextField can only select text visible or to the left of the cursor
-
- Resolved
-
-
JDK-8051691 Style of TextField has been changed since jdk7u6
-
- Closed
-
-
JDK-4253904 TextField.select() leaves caretPosition in different states depending on OS
-
- Closed
-