开发者

Losing Focus From A JTextField

开发者 https://www.devze.com 2022-12-26 15:52 出处:网络
After I use my textfield I can\'t get a jpanel that click on back into focus for my keylistener. It works for the mouselistener but all other keystrokes keep being detected by开发者_运维百科 the textf

After I use my textfield I can't get a jpanel that click on back into focus for my keylistener. It works for the mouselistener but all other keystrokes keep being detected by开发者_运维百科 the textfield not the jpanel.

The panel has been setFocusable(true) and works fine until i give the textfield the keyboard focus. It's like the textfield won't release the focus.

Any suggestions?


The answer was to call requestFocus() on the panel after the text action was performed

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号