JDK-4191032 : JTextField/Comp. can't consume KeyEvents under Win32 in 1.2RC2 (Solaris OK)
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.6,1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS:
    generic,solaris_2.5.1,windows_95,windows_nt generic,solaris_2.5.1,windows_95,windows_nt
  • CPU: generic,x86,sparc
  • Submitted: 1998-11-18
  • Updated: 1999-04-01
  • Resolved: 1999-04-01
Related Reports
Duplicate :  
Description

Name: krT82822			Date: 11/18/98


In response to bug 4186905, I would like to
place this on the table as a serious issue.
It is still around in rc2.

The biggest issue here is that the parent
component, a JTextField in my case, receives 
events and processes them anyway.

I have made an InputMask field for entering dates
and things, but since JTextFields goes about its
business on Windows without much regard for
anything else, my component is rendered useless
on Windows, while pretty handy on Solaris.

Here is some code that produces nothing when
keys are typed on Solaris (rightly) and is
ignored on Windows.  This will not be
easy to code around.

JTextField field = new JTextField();
field.addKeyListener(new KeyAdapter() {
	public void keyPressed(KeyEvent e) {
		e.consume();
	}
	public void keyTyped(KeyEvent e) {
		e.consume();
	}
	public void keyReleased(KeyEvent e) {
		e.consume();
	}
});
(Review ID: 42931)
======================================================================

Comments
EVALUATION This is a serious problem which is why the priority was increased on the bug this bug duplicates (4186905). A workaround is to call disableEvents(AWTEvent.INPUT_METHOD_EVENT_MASK) to disable input-method. timothy.prinzing@eng 1999-03-31
31-03-1999