File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Remove focus

 
Yog Ananth
Greenhorn
Posts: 27
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 68
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
use,
//in textfield1's key listener (key pressed and key = ENTER)
textfield2.requestFocus()

Hope This Helps
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic