Calenadrio Dispozsitivos Moviles
import javax.microedition.lcdui.*;
import java.io.IOException;
public class FechaHora extends MIDlet implements CommandListener {
private CommandexitCommand;
public Command Ingresar;
public Command Regresar;
private Display display;
private Form screen,screen1;
private Image img;
private Alert alt;
public FechaHora() {// Obtenemos el objeto Display del midlet.
display = Display.getDisplay(this);
Ingresar=new Command("Ingresar",Command.OK, 0);
Regresar=new Command("Regresar",Command.OK, 0);// Creamos el comando Salir.
exitCommand = new Command("Salir", Command.EXIT,2);
// Creamos la pantalla principal (un formulario)
screen = new Form("Interfaz de usuario");DateField fecha_nac = new DateField("Fecha de nacimiento y Hora:", DateField.DATE_TIME);
screen1 = new Form("Interfaz de Imagen");
TextField nombre = newTextField("Nombre:","",40,TextField.ANY);
TextField apellido = new TextField("Apellido:","",50,TextField.ANY);
String[] estados = {"Casado","Soltero","Divorciado","Viudo"};
String[] ciudades ={"Tumbes","Lima","Piura"};
TextField edad = new TextField("Edad:","",10,TextField.PHONENUMBER);
ChoiceGroup estado = new ChoiceGroup("Estado",List.EXCLUSIVE,estados,null);
ChoiceGroup lista = newChoiceGroup ("Seleciona Ciudad",List.EXCLUSIVE, ciudades,null);
screen.append(fecha_nac);
screen1.append(nombre);
screen1.append(apellido);
screen1.append(edad);screen1.append(estado);
screen1.append(lista);
// Añadimos el comando Salir e indicamos que clase lo manejará
screen.addCommand(Ingresar);
screen.addCommand(exitCommand);screen.setCommandListener(this);
screen1.addCommand(Regresar);
screen1.setCommandListener(this);
}
public void startApp() throws MIDletStateChangeException {
// Seleccionamos la pantalla a mostrar...
Regístrate para leer el documento completo.