Netbeans JComboBox KeyEvent

Hi;

The KeyTyped, or KeyPressed events are not working with the comboboxs.

Let us have a JTextFiels aa and a JComboBox cc

then using Netbeans you may define the follwoing routines;

private void aaKeyTyped(java.awt.event.KeyEvent evt) {

// TODO add your handling code here:

if (evt.getKeyChar()=='\n')

{ System.out.println("Enter keytyped");}

} // this is working fine

private void ccKeyTyped(java.awt.event.KeyEvent evt) {

// TODO add your handling code here:

System.out.println("enter this routine");

// it seems not entering the routine at all why?

// It entered the ccItemStateChanged routine only, while

// I need to build some code according to entering the Enter Key

if (evt.getKeyChar()=='\n')

{ System.out.println("Enter keytyped");}

} // this is not working at all

I am using Netbeans 5.0 & JDK1.5.06

Is this a Netbeans bug?

Any help;

Thanks;

[999 byte] By [Netbeans_Policya] at [2007-10-2 13:57:30]
# 1
First, use code tagsSecond, I'll have to assume you're registering the listeners correctly (there's no code showing it). Perhaps the combobox is consuming key events.And lastly, I have some reservations as to the sensibility of listening for Enter-key-presses on a
DaanSa at 2007-7-13 12:02:11 > top of Java-index,Security,Event Handling...