jQuery in Action, 3rd edition
The moose likes Swing / AWT / SWT and the fly likes Remove focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Remove focus" Watch "Remove focus" New topic

Remove focus

Yog Ananth

Joined: Dec 28, 2004
Posts: 27
How to remove focus from a particular component. Currently in my text field the cursor is blinking now i want to remove the cursor position.
sasi kala
Ranch Hand

Joined: Dec 17, 2004
Posts: 68
hi Ananth,

Use textfield1.setFocusable(false), then the field will not get focus at any time.

If you want to transfer focus from one textfiled to another
//in textfield1's key listener (key pressed and key = ENTER)

Hope This Helps
subject: Remove focus
It's not a secret anymore!