Auto Select text on textfield focus



I want to make JTextFields in my application automatically select all
text when they receive focus, whether by mouse or by keyboard. More
importantly, I don't want to have to manually install listeners on
every JTextField I create.
It seems to me that this should be doable with a modified Look And
Feel, but I know nothing about modifying a LaF. Ideally, I would like a
solution that would automatically work with any LaF, though this is
less important; if I have to customize a specific LaF of my choice and
stick with that, then it's not a problem.
I'd also like to hear of any other suggested methods for accomplishing
this feat.

Thanks in advance,
Eldon

.



Relevant Pages

  • Re: Swing - Detect how focus was moved?
    ... > I have a Swing UI containing JTextFields. ... > into a JTextField using the keyboard (eg. by pressing TAB), ...
    (comp.lang.java.programmer)
  • Swing - Detect how focus was moved?
    ... I have a Swing UI containing JTextFields. ... into a JTextField using the keyboard (eg. by pressing TAB), ... I _don't_ want to selectAll() if focus was ...
    (comp.lang.java.programmer)
  • Re: Auto Select text on textfield focus
    ... whether by mouse or by keyboard. ... I don't want to have to manually install listeners on ... every JTextField I create. ... but I know nothing about modifying a LaF. ...
    (comp.lang.java.gui)