Lose Focus

Hello,I have a textfield that I want it to lose focus when the user hits enter key. I'm wondering if there is a way to just lose focus without having another component gain focus or setting setFocusable to false and/or setRequestFocusEnabled to false.vyang
[278 byte] By [vyanga] at [2007-11-27 5:07:58]
# 1

You can probably call setFocusable to false, but of course you usually would want to re-enable that at some point.

But I'm not sure that there can be no focused component... except to declare all your components as non-focusable.

Simplest is to just call requestFocus on something else or nextFocus or whatever.

Very unusual for a text field, though. I don't know why you want to do this, but it seems not worth it, IMO.

bsampieria at 2007-7-12 10:27:17 > top of Java-index,Desktop,Core GUI APIs...
# 2
Hello,Thanks bsampieri, I will try that.vyang
vyanga at 2007-7-12 10:27:17 > top of Java-index,Desktop,Core GUI APIs...