commit-classpath
[Top][All Lists]
Advanced

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

[commit-cp] [bug #13228] swing: keyEvents not sent to KeyListener of JTe


From: Timo Lindfors
Subject: [commit-cp] [bug #13228] swing: keyEvents not sent to KeyListener of JTextArea
Date: Mon, 30 May 2005 14:41:41 +0000
User-agent: Elinks

URL:
  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13228>

                 Summary: swing: keyEvents not sent to KeyListener of
JTextArea
                 Project: classpath
            Submitted by: lindi
            Submitted on: Mon 05/30/05 at 14:41
                Category: classpath
                Severity: 3 - Normal
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
        Platform Version: None

    _______________________________________________________

Details:

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) { }
        }
}







    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?func=detailitem&item_id=13228>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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