I have a new class called SendSMS Aand the midlet name is Main
but when i execute the code and i select the send option, it brings a message on the emulator saying"Something went wrong runniing this app"
correct me please on where i have gone wrong so that when i select send button it brings the textfield for the phone number and also a textbox for the message.
here is the code:
the SendSMS is a class of Main Midlet that's why it does'nt extend Midlet.

public class SendSMS implements CommandListener {
Display display;
private TextField toWhom;
private TextField message;
private Alert alert;
private Command SendCommand,exit;
MessageConnection clientConn;
private Form compose;
public SendSMS() {

display.setCurrent(compose);
compose=new Form("Compose Message");
toWhom=new TextField("To","",10,TextField.PHONENUMBER);
message=new TextField("Message","",600,TextField.ANY);
SendCommand=new Command("Send",Command.BACK,0);
exit=new Command("Exit",Command.SCREEN,5);
compose.append(toWhom);
compose.append(message);
compose.addCommand(SendCommand);
compose.addCommand(exit);
compose.setCommandListener(this);
}


public void commandAction(Command cmd,Displayable disp) {

if(cmd==SendCommand) {
String mno=toWhom.getString();
String msg=message.getString();
if(mno.equals("")) {
alert = new Alert("Alert");
alert.setString("Enter Mobile Number!!!");
alert.setTimeout(2000);
display.setCurrent(alert);
}
else {
try {
clientConn=(MessageConnection)Connector.open("sms://"+mno);
}
catch(Exception e) {
alert = new Alert("Alert");
alert.setString("Unable to connect to Station because of network problem");
alert.setTimeout(2000);
display.setCurrent(alert);
}
try {
TextMessage textmessage = (TextMessage) clientConn.newMessage(MessageConnection.TEXT_MESSAGE);
textmessage.setAddress("sms://"+mno);
textmessage.setPayloadText(msg);
clientConn.send(textmessage);
}
catch(Exception e)
{
Alert alert=new Alert("Alert","",null,AlertType.INFO);
alert.setTimeout(Alert.FOREVER);
alert.setString("Unable to send");
display.setCurrent(alert) }
}}}}