Midlet TextBox  
Author Message
Chameleon





PostPosted: 2005-12-19 5:56:00 Top

java-programmer, Midlet TextBox -------------------
TextBox tb = new TextBox("title", null, 5, TextField.DECIMAL);
tb.addCommand(new Command("Ok", Command.BACK, 0));
tb.setCommandListener(this);

Display dis = Display.getDisplay(this);
dis.setCurrent(tb);
-------------------

The code above shows (in my mobile Sony Ericsson K300i) a TextBox with 2
Commands "Ok" and "Ok".

If TextBox is empty of chars, first "Ok" is grayed but second not.

I suspect that the first Command "Ok" is part of TextBox (Screen) and
when I press it, it does nothing and commandAction method does not run.
Only when I press the second Command "Ok" commandAction method runs.

So, first "Ok" is "feature" of my mobile or it is in MIDP Specification?
If the second, how can I get access to this Command?