⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 displayable1.java~11~

📁 手机游戏多客户端测试代码
💻 JAVA~11~
字号:

import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class Displayable1 extends Form {
  /** Constructor */
  TextField message;
  Command send ;
  Command exit ;
  MIDlet1 midlet;
  public Displayable1(MIDlet1 midlet) {
    super("Chat Form");
    this.midlet = midlet;
    try {
      jbInit();
    }
    catch(Exception e) {
      e.printStackTrace();
    }
  }

  /**Component initialization*/
  private void jbInit() throws Exception {
    // add the Exit command
    message = new  TextField("Message","",50,0);
    send = new Command("Send",Command.SCREEN ,1);
    exit = new Command("Exit",Command.EXIT ,1);
    addCommand(send);
    addCommand(exit);
    this.append(message) ;
  }
  public void commandAction(Command c,Displayable d)
  {
    if(c == send)
    {
      message.setString("hello");
    }
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -