0

As you can see in the title i dont know how to make a java text field with text in the background that disappears when you click on it. So theres a textfield that says "username" and when u click on it the username disapears and you can type in your password. Is it possible to do this without a new class?

1 Answers1

0

my suggestion is to use swingx library and use JXTextField. so you can set the text using setPrompt method.

hunter
  • 3,963
  • 1
  • 16
  • 19