|
Hmm, in the way you want it to be implemented, this is a little bit complex problem. Because you can't know when the user finished his job with a textfied!! You can just guess it!
How you can guess it? You can listen textfield for a specified time period which is acceptable by your users. For example once user starts typing, you can count number of milliseconds passed from the last character entered! When this passes a certain threshold, you can decide that the user finished his job with that textfield and transfer the focus to the other one. And you will need to implement this in a separate thread!
In my opinion, if your application is not targeting to a very specific data entry job, this is not the correct way to implement entering data. Because today or tomorrow, your users will not be satisfied with the threshold selected above. You can control focus with tab key (focus transferred when user press tab key) or you can think about a more innovative way of getting the data (e.g. via an input file).
|