Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: How to clear this field
|
Posted: Mar 14, 2002 11:18 AM
|
|
Another common method of dealing with this situation is not to empty out the field, but instead to select all the text in it. That way, if you start typing immediately, you replace the text, but this also allows for you to slightly alter the text without retyping it all, if that is preferred. This is how you would select all the text in a JTextField and also set the focus to that field:
entryField.selectAll();
entryField.requestFocus();
|
|