سلام امیدوارم این قطعه کدبتونه کمکتون کنه...public class Midlet_3 extends MIDlet implements CommandListener {
private TextBox nameTextBox;
private Alert alert;
private Command quit, hint, go;
private String boxText;
public Midlet_3(){
boxText = "harf:";
// #2 Generate a text box
nameTextBox = new TextBox ("Author Facts",
boxText, 60, TextField.PLAIN);
// #2.1 Commands
int s;
s=nameTextBox.getHeight();
quit = new Command("Quit", Command.EXIT, 2);
// #2.2 Create a list
go = new Command("View Info", Command.ITEM, 1);
hint = new Command("Hint", Command.ITEM, 1);
// #2.3 Register and add
nameTextBox.addCommand(go);
nameTextBox.addCommand(quit);
nameTextBox.addCommand(hint);
nameTextBox.setCommandListener(this);
}
public void startApp() {
Display.getDisplay(this).setCurrent(nameTextBox);
}
public void pauseApp() {
}
public void destroyApp(boolean unconditional) {
}
protected String getInformation(String authorName){
String info = new String();
// # 4.1 Strings contain line returns
if(authorName.equalsIgnoreCase("a")){
info = "آ";
}else if(authorName.equalsIgnoreCase("b")){
info = "ب";
}else if(authorName.equalsIgnoreCase("c")){
info = "س";
} else{
info = "Author not known.";
}
return info;
}