All pastes #747727 Raw Edit

j2me hecl

public java v1 · immutable
·published 2007-10-24 09:13 UTC
rendered paste body
package test;import org.hecl.*;import javax.microedition.io.Connector;import javax.microedition.lcdui.Command;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Form;import javax.microedition.lcdui.StringItem;import javax.microedition.midlet.MIDlet;import javax.microedition.midlet.MIDletStateChangeException;public class HeclWorld extends MIDlet {		private Display display;	private static final Command CMD_EXIT = new Command("Exit", Command.EXIT, 1);	protected void destroyApp(boolean arg0) {	}	protected void pauseApp() {	}	protected void startApp() throws MIDletStateChangeException {		if (display == null) {			display = Display.getDisplay(this);			Form main = new Form("Test");						try {				Interp interp = new Interp();				String heclcode =					"set form [lcdui.form -title \"Hello world\"]\n" +//					"set form [form label \"Hello world\"]\n" +					"$form setcurrent\n";				interp.eval(new Thing(heclcode));			} catch (HeclException e) {				// TODO Auto-generated catch block				e.printStackTrace();			}						display.setCurrent(main);		}	}}