当前页面: 开发资料首页 → J2ME 专题 → 请兄弟帮忙:手机文本式“Hello World !”的小程序
请兄弟帮忙:手机文本式“Hello World !”的小程序
摘要: 请兄弟帮忙:手机文本式“Hello World !”的小程序
如题,我以前用VB编了一个小程序,现有摩托罗拉A768智能手机一部,想在手机上运行此小程序,书虽看了不少,但始终不得其道。有哪位兄弟愿帮我一下,提供能在该手机上以文本框格式运行的Hello World !”的小程序内容(具体界面如下图所示),本人不胜感激!
:( 图片无法帖入。只好描述一下了:
在手机上运行后,出现一全屏的文本框,文本框最下边有三个按键,依次是“确定”、“清除”、“退出”。
点击“确定”后,文本框最左上出现了“Hello World !”;
点击“清除”后,文本框内容清除。
点击“退出”后,退出此小程序,返回手机状态。
补充说明一下,我想要Java程序,不是VB程序:)
免费的没有~~
这个简单 如果你要 我可以给一个坦克大战的游戏给你 我自己做的 源码
加我qq254672366
谢谢fangshao(方少)兄,我最主要的是想要一个在手机上能显示的文本框的小程序源码,仅此而已,能提供吗?谢谢!
同时也希望其他愿帮忙的兄弟帮我一下,谢谢!
再求
楼主是想看下J2ME程序是如何运行的吧~
小弟刚学正好有这个例子贴出来给你看看!也是从其他地方看的。。。
package demo;
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
public class HelloWorld extends MIDlet implements CommandListener{
private Form form;
//private Alert alt;
public HelloWorld() {
super();
// Create a new form on which to display our text
form = new Form("Test App");
// Add the text "Hello World!" to the form
form.append("Hello World!");
// Add a command button labeled "Exit"
form.addCommand( new Command( "Exit", Command.EXIT, 1 ) );
// Register this object as a commandListener
form.setCommandListener( this );
}
protected void startApp() throws MIDletStateChangeException {
// Get a reference to the display, and show the form
Display display = Display.getDisplay(this);
display.setCurrent( form );
}
protected void pauseApp() {
// TODO Auto-generated method stub
}
protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
form = null;
}
public void commandAction(Command c, Displayable d)
{
// Destroy this MIDlet
try{
destroyApp(true);
}catch(MIDletStateChangeException msce){
msce.printStackTrace();
}
// Notify the application management software that this MIDlet
// has entered the destroyed state
notifyDestroyed();
}
}
万分感谢hyl716(DeBug)兄!再次感谢!
举手之劳
gz