Simple Java GUI Question

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Let's say I have a bunch of JTextFields. What I want to do is, when I hit tab from one JTextField to another, I want the target JTextField to highlight the text in there. I can't find anything in the API that does this. Anyone?
 

Templeton

Senior member
Oct 9, 1999
467
0
0
You'll need to implement the FocusListener interface and call the selectAll method when the textfield fires a FocusEvent. If you need me to go more indepth, fell free to ask.
 

screw3d

Diamond Member
Nov 6, 2001
6,906
1
76
Originally posted by: Templeton
You'll need to implement the FocusListener interface and call the selectAll method when the textfield fires a FocusEvent. If you need me to go more indepth, fell free to ask.

Thanks! I'll see if I can implement it.. but if it's too much of a hassle I'll just forget about it. :)