E
Eddie Hsu
I have a paint program and say when i paint a square in the paint()
function, I was able to click the square then use up/down/left/right
to move it. However, after I added a textfield to my applet, the
keyListener does not work anymore; the square no longer moves. I
understand that the textfield is probably the first component in my
program which stole the focus and somehow causing conflict with my
keyListener. How can i lose defocus the textfield and get it back to
the applet (the default focus before the introduction of textfield).
Or how can i requestFocus on the applet without the focus
automactically slipping back to the textfield?
function, I was able to click the square then use up/down/left/right
to move it. However, after I added a textfield to my applet, the
keyListener does not work anymore; the square no longer moves. I
understand that the textfield is probably the first component in my
program which stole the focus and somehow causing conflict with my
keyListener. How can i lose defocus the textfield and get it back to
the applet (the default focus before the introduction of textfield).
Or how can i requestFocus on the applet without the focus
automactically slipping back to the textfield?