KeyListener does not capture Arrow key Events in textField

Love................ I added a key listener to TextFieldit does not detectArrow Keys events in keyTyped, KeyPressed,KeyReleased methodswhy? I want to shift focus from a textfield to other component on capturing Arrow key Pressed How
[287 byte] By [shahidjava] at [2007-9-26 2:08:19]
# 1

i dont know where did you do themistake but these works

look at the code i hope it will help:

import java.awt.*;

import java.awt.event.*;

public class MyFrame extends Frame

{

TextField a=new TextField();

TextField b=new TextField();

public MyFrame()

{

a.setBounds(50,50,100,30);

b.setBounds(50,100,100,30);

add(a);

add(b);

setSize(405,305);

setLayout(null);

addWindowListener(new WindowA());

a.addKeyListener(new KeyA());

}

public void setVisible(boolean b)

{

if(b)

{

setLocation(50, 50);

}

super.setVisible(b);

}

static public void main(String args[])

{

try

{

(new MyFrame()).setVisible(true);

}catch (Throwable t){}

}

class WindowA extends WindowAdapter

{

public void windowClosing(WindowEvent event)

{

System.exit(0);

}

}

class KeyA extends KeyAdapter

{

public void keyPressed(KeyEvent event)

{

if(event.getKeyCode()==event.VK_DOWN)

b.requestFocus();

}

}

}

98028140 at 2007-6-29 8:56:42 > top of Java-index,Desktop,Core GUI APIs...