aspose file tools
The moose likes Swing / AWT / SWT and the fly likes need JTextField that change color when focused Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply Bookmark "need JTextField that change color when focused " Watch "need JTextField that change color when focused " New topic
Author

need JTextField that change color when focused

Francesco Pezzino
Greenhorn

Joined: Oct 30, 2001
Posts: 7
I need to implement a JTextField that turn its background yellow when has focus and turn back white when there is any focus.
Please can someone give me some suggestions ? thanks in advance
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi,
I suggest using FocusListener. Change background to yellow in focusGained method and change background to white in focusLost method.
Regards,
Manfred.
Francesco Pezzino
Greenhorn

Joined: Oct 30, 2001
Posts: 7
Thanks Manfred for the suggestion, I think it's a smart way to solve this problem, I'll implement this way.
Francesco
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: need JTextField that change color when focused
 
Similar Threads
JTextField
Listern Problem on Disabled JTextField
How to make JPopupMenu invisible?
java swings question
change backcolor in JtextField