-
Bug
-
Resolution: Fixed
-
P2
-
1.1.6, 1.2.0, 1.2.1
-
1.2.2
-
generic, x86, sparc
-
generic, solaris_2.5.1, windows_95, windows_98, windows_nt
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2023665 | 1.3.0 | Norbert Lindenberg | P2 | Resolved | Fixed | kestrel |
********************************************************************************
This bug record is specific to Java 2 SDK Standard Edition v. 1.2 and v. 1.2.1.
Please do not add customer calls relating to 1.1.x to this record.
********************************************************************************
Name: tb29552 Date: 11/03/98
/*
JTextPane no longer dispatches keyTyped events
The following code reproduces this problem.
When run under i586/win_nt_4.0 you will see
only the keyPressed and keyReleased events.
Run the same demo under SPARC/Solaris and you
will see keyPressed, keyTyped and keyReleased
for each key you strike.
This showed up under JDK 1.2 RC 1 and worked
fine under JDK 1.2beta4:
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* Demonstrates problems with JDK1.2 RC 1--JTextPane no longer
* dispatches keyTyped events like it used to in JDK1.2beta4. Typing
* some characters in the pane after startup will show that only
* keyPressed and keyReleased events are generated...
*/
public class TestJTP {
private static final float INITIAL_DOC_HEIGHT_PERCENT = 0.20f;
private static final float INITIAL_WIDTH_PERCENT = 0.37f;
public static void main(String[] argv) {
JFrame aFrame = new JFrame();
Dimension aScreenRes = Toolkit.getDefaultToolkit().getScreenSize();
aScreenRes.height = (int) (INITIAL_DOC_HEIGHT_PERCENT
* aScreenRes.height);
aScreenRes.width = (int) (INITIAL_WIDTH_PERCENT
* aScreenRes.width);
JTextPane itsTextPane = new JTextPane();
JScrollPane itsScrollPane = new JScrollPane(itsTextPane,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
itsScrollPane.setPreferredSize(aScreenRes);
// Register the listener to keep track of keyboard events:
itsTextPane.addKeyListener(
new KeyAdapter() {
public void keyTyped(KeyEvent e) {
System.out.println("Key type detected:" + e.getKeyChar());
}
public void keyPressed(KeyEvent e) {
System.out.println("Key press detected:" + e.getKeyChar());
}
public void keyReleased(KeyEvent e) {
System.out.println("Key release detected:" + e.getKeyChar());
}
}
);
aFrame.getContentPane().setLayout(new BorderLayout());
aFrame.getContentPane().add(itsScrollPane, "Center");
aFrame.pack();
aFrame.setVisible(true);
}
}
(Review ID: 41481)
======================================================================
daniel.indrigo@Canada 1999-01-19
JTextfield has the same problem
This bug record is specific to Java 2 SDK Standard Edition v. 1.2 and v. 1.2.1.
Please do not add customer calls relating to 1.1.x to this record.
********************************************************************************
Name: tb29552 Date: 11/03/98
/*
JTextPane no longer dispatches keyTyped events
The following code reproduces this problem.
When run under i586/win_nt_4.0 you will see
only the keyPressed and keyReleased events.
Run the same demo under SPARC/Solaris and you
will see keyPressed, keyTyped and keyReleased
for each key you strike.
This showed up under JDK 1.2 RC 1 and worked
fine under JDK 1.2beta4:
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
/**
* Demonstrates problems with JDK1.2 RC 1--JTextPane no longer
* dispatches keyTyped events like it used to in JDK1.2beta4. Typing
* some characters in the pane after startup will show that only
* keyPressed and keyReleased events are generated...
*/
public class TestJTP {
private static final float INITIAL_DOC_HEIGHT_PERCENT = 0.20f;
private static final float INITIAL_WIDTH_PERCENT = 0.37f;
public static void main(String[] argv) {
JFrame aFrame = new JFrame();
Dimension aScreenRes = Toolkit.getDefaultToolkit().getScreenSize();
aScreenRes.height = (int) (INITIAL_DOC_HEIGHT_PERCENT
* aScreenRes.height);
aScreenRes.width = (int) (INITIAL_WIDTH_PERCENT
* aScreenRes.width);
JTextPane itsTextPane = new JTextPane();
JScrollPane itsScrollPane = new JScrollPane(itsTextPane,
JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
itsScrollPane.setPreferredSize(aScreenRes);
// Register the listener to keep track of keyboard events:
itsTextPane.addKeyListener(
new KeyAdapter() {
public void keyTyped(KeyEvent e) {
System.out.println("Key type detected:" + e.getKeyChar());
}
public void keyPressed(KeyEvent e) {
System.out.println("Key press detected:" + e.getKeyChar());
}
public void keyReleased(KeyEvent e) {
System.out.println("Key release detected:" + e.getKeyChar());
}
}
);
aFrame.getContentPane().setLayout(new BorderLayout());
aFrame.getContentPane().add(itsScrollPane, "Center");
aFrame.pack();
aFrame.setVisible(true);
}
}
(Review ID: 41481)
======================================================================
daniel.indrigo@Canada 1999-01-19
JTextfield has the same problem
- backported by
-
JDK-2023665 JTextPane no longer dispatches keyTyped events to a KeyListener
- Resolved
- duplicates
-
JDK-4245061 In Win32, AWTEventListener missed KEY_TYPED event for swing component.
- Closed
-
JDK-4197167 KeyEvent differences between Solaris and Windows
- Closed
-
JDK-4200735 For characters typed (e.g. ABCDE....) no keyTyped event is generated
- Closed
-
JDK-4191032 JTextField/Comp. can't consume KeyEvents under Win32 in 1.2RC2 (Solaris OK)
- Closed
- relates to
-
JDK-4159610 Menu accelerator gets inserted into text
- Resolved
(1 relates to)