• Post Reply Bookmark Topic Watch Topic
  • New Topic

Silly doubt on AWT TextField  RSS feed

 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
Here is my doubted program.




When I run the program, I have seen the cursor is enabled on the TextField. I wanted to get rid off that. so ,I went to Google search and wrote

TextField how to take off cursor focus in AWT- Searched.

But I couldn�t find any. I wasted my time on this about an hour or so. I might be so stupid that I don� know how to search in Google in an effective way.

Questions
---------
Please help me,how to search our java questions in google to get appropriately what we are looking ? Please show me the way to learn java in an effective way?

How can I take off the cursor focus in TextField?
 
Keith Lynn
Ranch Hand
Posts: 2409
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe there may be a setEditable method in TextField.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JTextField (in javax.swing) has a setEditable method inherited from JTextComponent. However, I don't think a TextField (in java.awt) has this.

If you know it should not be edited (and you want to stick with awt rather than swing), then perhaps a TextArea is what you want?
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Friends,
Finally,I fixed my problem.setFocusable method in TextField took off the cursor position from TextField.Thanks for your effort.
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Keith and Marc,
Thanks for your effort.My question was the cursor focus is placed in the TextField when I run the program.I didn�t want to edit the text in the TextField.I Just wanted to get rid off the cursor blinking on the TextField.Finally,I fixed the problem through setFocusable method.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shiva Mohan:
...I fixed my problem.setFocusable method in TextField took off the cursor position from TextField...

Cool. I almost moved this to the Swing/AWT forum. In the future, you might want to post these types of questions there for expert consideration.
 
Shiva Mohan
Ranch Hand
Posts: 486
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok,thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!