• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTextField question

 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there any way to make an entry disappear once a user presses
enter. Eg John is typed into a textfield and once the user presses enter the textfield is once again blank
Thank you for your help.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

yup, there is.
When the enter (return) key is pressed in the TextField, an action event is generated and
you could add an action listner which will set the TextField
to " ".
One way of doing it.
regds.
- satya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic