This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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
I agree. Here's the link:
subject: Remove focus
Similar Threads
How to remove focus from JFileChooser
WA #1.....word association
Focus Lost throws error
Remove highlight from a textbox