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 Android Security Essentials Live Lessons this week in the Android 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
Don't get me started about those stupid light bulbs.
subject: Remove focus
Similar Threads
Remove highlight from a textbox
WA #1.....word association
How to remove focus from JFileChooser
Focus Lost throws error