look i have notes program and i want at the textfield for name to write "Enter name" and in noteArea to write "Place some notes" and when you will click on one of theese to disapear and you continue writing so its not for online purposes hope you understand what i mean ..
After a few experiments I find that I get good results with implementing a custom JPanel to hold a JTextField. Instead of putting the text in the JTextField's Document, I override paint on the JPanel so that I can draw over the children of the panel and use that to draw the text I want over the JTextField if the field is empty and doesn't have focus. I also add a FocusListener that calls repaint() on my custom JPanel for the field losing or gaining focus.
This way you don't have to deal with any complications from having the text that you want to disappear being actually in the field. You don't have to worry about confusing your text with text that the user actually entered, and if the user leaves the field blank your text reappears.