I want to focus on a TextField every time I show a Form.Did anyone know how?
I want to focus on a TextField every time I show a Form.Did anyone know how?
should be able to use form.setselected(item) or is it item.setSelected, note, this is only MIDP 2.0
Jason Glass
http://IChiBanComputers.Com
It seems it's not possible to set focus, right?![]()
we were using setselected, which from a MS standpoint, is similar to setfocus
but had to remove it, or put in preprocessor statements, for doing MIDP 1.0 builds as it was not supported.
I think it works?
Jason Glass
http://IChiBanComputers.Com
you, and juarez are so correct, i am sorry, it is only for a list, i.e. lcdui.list
there is getselectedindex and setselectedindex methods
I was going through all this code, and I just kept seeing it 20 plus times, and though it was inherited from lcdui.item
I apologize
Anyone know how to implement something similar?
Jason Glass
http://IChiBanComputers.Com
This is exactly what I wanted to do in a game I'm developing. The user needed to input text into a textfield, so I wanted that field focused as default. You can use the following command to achieve this:
display.setCurrentItem(item);
where 'display' is a reference to the midlet diapay and 'item' is the component to focus upon.
Cheers
Something I would like to know, is how to force an form component to retain focus. (ie, so a user cannot press the up/down arrows, changing the focus of a component). I can manage this using a customitem and overriding the traverse method, but can't do this with standard components, such as textfields.
Or perhaps this is asking a bit much! Any ideas??!
nice pervasiveapp, I though there was a way
with your dilemma, it sucks their is no lostfocus, focus changed, onchange methods, like there are in other languages
Jason Glass
http://IChiBanComputers.Com