Plantilla Midlet comentada y conversor
Plantilla Midlet
	/*
	 * To change this template, choose Tools | Templates
	 * and open the template in the editor.
	 */
	
	package hello;
	
	import javax.microedition.midlet.*;
	
	// lcdui lo necesitamos para Display y si usamos CommandListener
	import javax.microedition.lcdui.*;
	
	// Después de tomar el Display (se coge no se crea) podemos
	// usar screens (múltiples). Form, TextBox y List son hijas de Screen
	
	// Canvas sería como los Screens pero para gráficos
	
	/**
	 * @author luser
	 * El CommandListener lo necesitamos para poder meter comandos
	 * que interrumplan
	 */
	public class PrimerMidlet extends MIDlet implements CommandListener {
	    
	    private Command ordenSalida;
	    private Display pantalla;
	    private Form formulario;
	
	    public PrimerMidlet ()
	    {
	        pantalla = Display.getDisplay(this);
	        // Create the Exit command, la prioridad es 2, muy alta
	        ordenSalida = new Command("Salir", Command.EXIT, 2);
	        // Create the main screen form
	        formulario = new Form("El primero");
	        // Create a string item and add it to the screen
	        StringItem strItem = new StringItem("Título", "pasa tron");
	        formulario.append(strItem);
	
	        // Esto sería usar un softbutton, es decir, una orden
	        // que utilice botones concretos del dispositivo, que son pocos.
	        // este tipo de comandos deben ser los más cruciales.
	            // Set the Exit command
	        formulario.addCommand(ordenSalida);
	        formulario.setCommandListener(this);
	    }
	    public void startApp() {
	        pantalla.setCurrent(formulario);
	    }
	
	    public void pauseApp() {
	    }
	
	    public void destroyApp(boolean unconditional) {
	    }
	
	        /**
	     * commandAction
	     * captura ordenes
	     */
	    public void commandAction (Command c, Displayable s) {
	        if (c == ordenSalida) {
	            // el false significa que el Midlet puede cancelar la orden
	            destroyApp (false);
	            // este avisa al gestor de aplicaciones del dispositivo que ya está.
	            notifyDestroyed ();
	        }
	    }
	}
	 
Conversor de euros
	package hello;
	
	import javax.microedition.midlet.*;
	import javax.microedition.lcdui.*;
	
	public class Conversor extends MIDlet implements CommandListener {
	
	    private Command exitCommand; // The exit command
	    private Command convertCommand; // The exit command
	    private Display display;     // The display for this MIDlet
	    private TextBox cajaTexto;
	
	    public Conversor() {
	        display = Display.getDisplay(this);
	        exitCommand = new Command("Exit", Command.EXIT, 0);
	        convertCommand = new Command("Convertir", Command.OK, 0);
	    }
	
	
	     /**
	     * Pause, discontinue with the http tests
	     */
	    public void pauseApp () {
	    }
	    
	    public void startApp() {
	        cajaTexto = new TextBox("Inserta euros","0",20,0);
	
	        cajaTexto.addCommand(exitCommand);
	        cajaTexto.setCommandListener(this);
	
	        cajaTexto.addCommand(convertCommand);
	        cajaTexto.setCommandListener(this);
	
	        display.setCurrent(cajaTexto);
	    
	
	    }
	
	    public void destroyApp(boolean unconditional) {
	    }
	
	    public void commandAction(Command c, Displayable s) {
	                double pesetas = 0;
	                if (c == convertCommand)
	                {
	                    pesetas = Double.parseDouble(cajaTexto.getString()) * 166.386;
	                    cajaTexto.setString("yeah: " + pesetas);
	                }
	                else if (c == exitCommand)
	                {
	                        destroyApp(false);
	                        notifyDestroyed();
	                }
	
	    }
	
	}
	 
 pello.io
    pello.io