Pham_loi
Chức vụ: 14:08:01, 15-08-2016 |
<?php
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Midlet extends MIDlet implements CommandListener
{
private Display display;
private TextBox textbox;
private List list;
public void startApp(){
display=Display.getDisplay(this);
textbox=new TextBox("TextBox", "Đây là TextBox", 50,0);
list=new List("Danh sách", List.IMPLICIT);
list.append("Vào TextBox", null);
list.append("Thoat", null);
list.setCommandListener(this);
display.setCurrent(list);
}
public void pauseApp(){
}
public void destroyApp(boolean abs){
}
public void commandAction(Command cm, Displayable dl){
if(cm==List.SELECT_COMMAND){
switch(list.getSelectedIndex()){
case 0:
display.setCurrent(textbox);
break;
case 1:
notifyDestroyed();
break;
}
}
}
}
?>
Copy code
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class Midlet extends MIDlet implements CommandListener
{
private Display display;
private TextBox textbox;
private List list;
public void startApp(){
display=Display.getDisplay(this);
textbox=new TextBox("TextBox", "Đây là TextBox", 50,0);
list=new List("Danh sách", List.IMPLICIT);
list.append("Vào TextBox", null);
list.append("Thoat", null);
list.setCommandListener(this);
display.setCurrent(list);
}
public void pauseApp(){
}
public void destroyApp(boolean abs){
}
public void commandAction(Command cm, Displayable dl){
if(cm==List.SELECT_COMMAND){
switch(list.getSelectedIndex()){
case 0:
display.setCurrent(textbox);
break;
case 1:
notifyDestroyed();
break;
}
}
}
}
?>
Copy code
Nguồn: thienlong326
: 0 ♥
Trực Tuyến:
Khách: 1