0

import com.sun.lwuit.Command; import javax.microedition.midlet.; import javax.microedition.lcdui.;

in my code but still the following errors are coming...

exitCommand = new Command("Exit", Command.EXIT, 2);  //line 1
 textbox.addCommand(exitCommand);                     //line 2

Command.EXIT cannot be resolved..

The method addCommand(Command) in the type Displayable is not applicable for the arguments (Command)

bharath
  • 14,283
  • 16
  • 57
  • 95
garima
  • 5,154
  • 11
  • 46
  • 77

2 Answers2

1

There is no constructor to pass like this. Try to learn LWUIT and see this linkfor your reference. You can't use LWUIT command for J2me textbox.

halfer
  • 19,824
  • 17
  • 99
  • 186
bharath
  • 14,283
  • 16
  • 57
  • 95
1

You are importing LWUIT Commands, but using the LCUID Command methods. Your code would be right if you were importing javax.microedition.lcdui.Command;. But if you want to use LWUIT components, you have to forget about Items and moreover Item Commands.

I don't know if it's agood idea to mix LCUID and LWUIT, but well, I haven't used it, so I can't really say.

mdelolmo
  • 6,417
  • 3
  • 40
  • 58