posted 17 years ago
there is no buttons in the same way as on windows applications etc.
If you want to use commands you have to add them to the form using Form.addCommand()
This will add the command buttons but will place them under the softkeys and if you have more than 2 commands they will be placed in a menu bar accessed by one of the softkeys
If its a calculator you are planning on making which is going to resemble a calculator like the one in windows then you are going to find it very difficult. This is because the lcdui, is very poor in organising layout. You may need to use a canvas and implement your own ui.
But if you want a button added to your form then you can use either an ImageItem (which would probably be best in your case) or a StringItem.
When you declare wither one, set the apperanceMode parameter to either Image Item.BUTTON or StringItem.BUTTON, depending on which you use.
You will have to have a command already declared and set it to be the default command of the ImageItem or StringItem
These items are now commands so in order for your code to recognise an event when they are pressed you must set an ItemCommandListener to the StringItem or ImageItem
you will have to implement the commandAction(Command command, Item item) method when implementing the ItemCommandListener. This gets called when you select the button item.
"its bad luck to be superstitious....."