title: displaying an alert on call of a process in j2me
body: <p>I am working on an application for nokia e71.I want to display an alert for a time interval between Locfinder.ex() function is called  and it returns the location value.Do i need to create a separate thread?
  I am very new to Java so still not clear with all the concepts.I am pasting my code here.Pleas give some suggestions.</p>
  
  <pre><code>   /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
  
    package org.ets.screen;
    import javax.microedition.lcdui.Command;
    import javax.microedition.lcdui.CommandListener;
    import javax.microedition.lcdui.Displayable;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.TextField;
    import org.ets.midlet.ETS_infozech;
    import org.ets.utils.Chacheck;
    import org.ets.utils.Constants;
    import org.ets.utils.Locfinder;
    import org.ets.utils.TextMessageSender;
  
  
    /**
    *
    * @author Deepshikha
    * Purpose:for Check_out form
    * Date:21-April-2014
    * 
    * Modified by:Deepshikha Date:-16-May-2014 Purpose:-to add geotagging
    */
    public class check_out extends Form implements CommandListener{
  
  private TextField txtSapId;
  private Command send, back;
  String smsTxt;
  String smsNumber = Constants.phone_Number;
  TextMessageSender sendMessage;
  ETS_infozech midlet;
  
  public check_out(ETS_infozech midlet) {
      super("Check_out Details"); //for the constructor of Form class
      this.midlet = midlet;
  
      txtSapId = new TextField("SAP ID:", "", 15, TextField.ANY); // for SAP ID
  
      send = new Command("Send", Command.OK, 1);
      back = new Command("Back", Command.BACK, 2);
  
      sendMessage = new TextMessageSender(midlet);
  
      append("Please Enter Detail");
      append("");
      append(txtSapId);
      append("");
      addCommand(send);
      addCommand(back);
      setCommandListener(this);
  
  }
  
   public void commandAction(Command c, Displayable d) {
      if (c == send) {
          String valSapId = txtSapId.getString();
  
          if (valSapId.length() &lt;= 0) {
              midlet.showalert("Please enter SAP ID");
          }
  
  
  
          else {
               int a;
               a=Chacheck.check(valSapId);//to valiadmindate SAPId field
               if (a==1){
  
  
                   midlet.showalert("Remove White space from SAPID!!!");
  
               }
               else if(a==2){
  
                   midlet.showalert("Symbols in sapid textbox!!!");
  
               }
               else{
  
                   smsTxt = "FNX COUT " + "SAPID-" + valSapId ;
  
  
                  String s=Locfinder.ex();
                  if(s==null){
                      midlet.showConfirm(smsTxt);
  
                  }
  
                  else{
                  smsTxt=smsTxt+s;
                  System.out.println(smsNumber + " ******** " + smsTxt);
                  sendMessage.sendTextMessage(Constants.phone_Number, smsTxt);// for sending message with required string and MSISDN no.
  
                  }
                  }        
          }
      } else if (c == back) {
          midlet.showMainMenu();
      }
  }
  </code></pre>
  
  <p>}</p>