bug-classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug classpath/22959] swing: keyEvents not sent to KeyListener of JTextA


From: gcc-bugzilla at gcc dot gnu dot org
Subject: [Bug classpath/22959] swing: keyEvents not sent to KeyListener of JTextArea
Date: 16 Oct 2005 01:27:47 -0000

Steps to reproduce:
1. Compile and run the attached testcase.
2. Type something to the textarea.

Expected results:
1. Strings "KeyTyped" and "KeyPressed" are printed to stdout when
you type something to the textarea.

Actual results:
1. Nothing is printed to stdout.

Testcase:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class keyhandler extends JFrame {
        public static void main(String[] args) {
                (new keyhandler()).show();
        }
        public keyhandler() {
                JTextArea a = new JTextArea(80, 25);
                a.addKeyListener(new KeyHandler());
                this.setContentPane(a);
                this.setSize(new Dimension(400, 400));
        }
        private class KeyHandler implements KeyListener {
                public void keyTyped(KeyEvent e) {
System.out.println("keyTyped"); }
                public void keyPressed(KeyEvent e)
{System.out.println("keyPressed"); }
                public void keyReleased(KeyEvent e) { }
        }
}


------- Comment #1 from from-classpath at savannah dot gnu dot org  2005-06-01 
09:02 -------
I checked in a fix for that. Please test and close the bug if it works.


------- Comment #2 from from-classpath at savannah dot gnu dot org  2005-06-01 
11:15 -------
Nice, seems to work now. (I probably don't have permissions to close the bug
since I can't see such an option on this web page even if I am logged in).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22959





reply via email to

[Prev in Thread] Current Thread [Next in Thread]