File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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
I agree. Here's the link:
subject: Remove focus
It's not a secret anymore!