dtnder
dtnder

Reputation: 389

set text cursor in text field, Java

I have two text fields, and text_field2 text_fiel1. when the program is run directly to the text cursor automatically text_field1. I want to ask how can I make the text cursor when the program is run automatically in text_field2 not in text_cursor1???

Upvotes: 1

Views: 13746

Answers (1)

vikas devde
vikas devde

Reputation: 11751

requestFocus() method of JTextfield will do. look at this http://www.java2s.com/Code/JavaAPI/javax.swing/JTextFieldrequestFocus.htm

Upvotes: 8

Related Questions