Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Clear JTextField

aneesahamedaaJul 31 2008 — edited Jul 31 2008
I have a JTextfield containing the text "Please enter your E-mail address:" set as default. When I click inside this textfield, it should get cleared.
This should happen only for "Please enter your E-mail address:", ie; after we start typing the address, if we move to some other component and come back to this text field and continue typing, the string which we have entered should not get cleared.
How to do this?
Rony
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 28 2008
Added on Jul 31 2008
4 comments
455 views