Java - swing listen an action in a text field of a form

Viewed 3348

I would like to develop a form with some text field.
example:

Name
SecondName

the idea is that every text field have inside a text like:

Insert your name
Insert your second name

when you click on the first text field to write your name, the text "Insert your name" have to be deleted... the same have to happen for the second text field (SecondName).
The effect have to be this:
enter image description here

I think that i just need an Action on the text field that have to wake up when the user press on the mouse on the text field, it's possible?
Thank you

3 Answers
Related