-
Bug
-
Resolution: Fixed
-
P3
-
1.4.0, 1.4.1
-
04
-
x86
-
windows_nt, windows_2000
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2117796 | 1.4.2 | Kdm Kdm | P3 | Resolved | Fixed | mantis |
Name: pa48320 Date: 08/27/2002
Put the focus in a JTextArea and press Alt+Right, this types a "B".
I tried to trace the origin of the problem and it seems to come from the type-ahead feature that generates a keyTyped event.
This is a major problem for JDeveloper since those keys are used to navigate between editors.
The following case is a trivial application that creates a JTextArea. Run the application and type Alt+Left, Alt+Right, Alt+PgUp, ... and you will see that characters are typed into the text.
import java.awt.*;
import javax.swing.*;
public class Application1
{
public static void main(String[] args)
{
JFrame frame = new JFrame();
frame.getContentPane().setLayout(new BorderLayout());
frame.getContentPane().add(new JTextArea());
frame.setBounds(100, 100, 200, 200);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
The problem is reproducable with JDK1.4.0 and 1.4.1 but was not present in previous releases.
(Review ID: 163671)
======================================================================
I can reproduce the bug on Win2k.
Do not see what it has to do with the text package.
Take a look at the following example.
--
import java.awt.*;
import java.awt.event.*;
public class Application1 {
public static void main(String[] args) {
Frame frame = new Frame();
Panel panel = new Panel();
frame.add(panel);
panel.addKeyListener(
new KeyAdapter() {
public void keyPressed(KeyEvent e) {
System.out.println("Application1.keyPressed "+e);
}
public void keyTyped(KeyEvent e) {
System.out.println("Application1.keyTyped "+e);
}
public void keyReleased(KeyEvent e) {
System.out.println("Application1.keyReleased " + e + "\n");
}
}
);
frame.setBounds(100, 100, 200, 200);
frame.setVisible(true);
}
}
--
When Alt+Right is pressed
java.awt.event.KeyEvent[KEY_TYPED, keyCode=0, keyChar='B', keyLocation=KEY_LOCATION_UNKNOWN] get generated.
That is why 'B' is typed in JTextArea.
###@###.### 2002-09-04
- backported by
-
JDK-2117796 Alt+Left/right/up/down generate characters in JTextArea
-
- Resolved
-
- duplicates
-
JDK-4496741 KeyListeners wont get Alt+LeftArrow events when using special Logitech mouses
-
- Closed
-
-
JDK-4501485 Alt-arrow keys enters strange characters in TextComponents
-
- Closed
-
-
JDK-4708221 REGRESSION: Extra KEY_TYPED keyevent generated with missing modifiers
-
- Closed
-
- relates to
-
JDK-6655141 Alt+Numpad_Left etc. generate character in JTextArea
-
- Open
-
-
JDK-4710498 KeyBind Ctrl+BackSpace does not function correctly with IME
-
- Closed
-
(1 relates to)