aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTextField question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTextField question" Watch "JTextField question" New topic
Author

JTextField question

john mattucci
Ranch Hand

Joined: Nov 03, 2000
Posts: 331
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

Joined: Jun 03, 2000
Posts: 5040

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

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTextField question