somebody know how to make the text which is in the text field on click to disapear
ex: If saying "Search" when ill click on the text field the text to disapear and i can write ...
Thanks ! :)
StefanRafa0
-3
Junior Poster in Training
Recommended Answers
Jump to PostYou can just do it by javascript.
Onclick event just change the element value with "".
For eg:-<script> function makeBlank() { document.getElementById("search").value=""; } </script> <input type="text" value="Search" onclick="makeBlank();" id="search">
Jump to PostI think a FocusListener is what you need.
Also re-read this post.
Jump to PostAfter a few experiments I find that I get good results with implementing a custom
JPanel
to hold aJTextField
. Instead of putting the text in theJTextField
'sDocument
, I overridepaint
on theJPanel
so that I can draw over the children of the panel and use that to …
All 9 Replies
IIM
163
Master Poster
StefanRafa0
-3
Junior Poster in Training
IIM
163
Master Poster
StefanRafa0
-3
Junior Poster in Training
StefanRafa0
-3
Junior Poster in Training
IIM
163
Master Poster
StefanRafa0
-3
Junior Poster in Training
mvmalderen
2,072
Postaholic
bguild
163
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.