è 點擊 下一步 進入 新建J2ME Midlet 程序。在名稱處輸入:HelloWorld。然后點擊 完成 ,系統就會自動生成一些代碼。如下所示。
è 我們在Eclipse生成的程序里新增一兩句話,就可以做HelloWorld這個最簡單的程序了。
import javax.microedition.midlet.MIDlet; import javax.microedition.midlet.MIDletStateChangeException; /* * Created on 2004-10-21 * * TODO To change the template for this generated file go to * Window - PReferences - Java - Code Style - Code Templates */
/** * @author Administrator * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class HelloWorld extends MIDlet { private TextBox textbox; //新增 /** * */ public HelloWorld() { super(); textbox = new TextBox("HelloWorld ", "你好,歡迎來到J2ME的世界!", 20, 0); //新增 // TODO Auto-generated constrUCtor stub }