Unfocus TextEditor when user clicks off

When the user clicks outside of textEditor I want the TextEditor to lose focus. Whats the best way to do this?

(Thankyou for spelling "lose" correctly. I think you must be in the minority on this forum!)

It will of course lose focus if something else gets focus, so you'd just need to make sure that whatever other component you expect the user to click on is set up to accept focus.

For accepting focus is using setWantsKeyboardFocus(true) the correct way? 

Yep. There are a few methods in component for controlling the way focus is passed around, but that's the main one.