This is my code:
package hello;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
/**
* @author User
*/
public class TBexample extends MIDlet
{
Display display;
public static String txt;
TextBox sample;
public TBexample()
{
txt = "enter your text here";
}
public void startApp()
{
// String localtext ="hi";
display = Display.getDisplay(this);
sample = new TextBox("play","",16,TextField.ANY);
//sample.insert(localtext,0);
sample.setString(txt);
display.setCurrent(sample);
}
public void pauseApp() {
txt = sample.getString();
}
public void destroyApp(boolean unconditional) {
}
}
****************************************************
i am getting a illegal argment Ecxeption for calling sample.SetString(txt).bt instead txt(class variable) of that if i use a local variable that works fine.Can anyone tell why?