J2ME... Setting Focus on a Text Field

Hopefully a really simple one today...  I have a form with a number of fields:

        timeForm = new Form("Time");
        timeinPSTField = new TextField("PST Time In or Minutes?", "", 4, TextField.NUMERIC);
        timeoutPSTField = new TextField("PST Time Out or 0?", "", 4, TextField.NUMERIC);
        timeinField = new TextField("EXEMPT Time In or Minutes?", "", 4, TextField.NUMERIC);
        timeoutField = new TextField("EXEMPT Time Out or blank?", "", 4, TextField.NUMERIC);
        timeForm.append(timeinPSTField);
        timeForm.append(timeoutPSTField);
        timeForm.append(timeinField);
        timeForm.append(timeoutField);
        timeForm.addCommand(okCommand);
        timeForm.addCommand(exitCommand);
        timeForm.setCommandListener(this);

How do I set the focus to a specific field...  Ie - Something like timeoutPSTField.setFocus().

Thanks in advance!

-Mike
NerdyMikeAsked:
Who is Participating?
 
x4uCommented:
You can do it this way:

yourMidlet.getDisplay().setCurrentItem(timeoutPSTField);
0
 
NerdyMikeAuthor Commented:
So easy when you get the exact code!  I looked on Google for 45 minutes and couldn't easily find it!  (I found similar ones but not as precise as yours).


Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.