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!

background text in JTextfield

843805Nov 28 2006 — edited Nov 28 2006
Hi,

I would like to make my JTextField have a default grey text which is removed when the user clicks in the textfield. Furthermore it should be turn up again if focus is removed trom the JTextField whithout the user having typed any text.

In other words, it should work as the default searchfield in the new IE 7.

Is this functionallity implemented in JTextField as default, or should I add focuslisteners to implement it myself?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 26 2006
Added on Nov 28 2006
2 comments
1,175 views