J2ME中文教程 7 开发无线网络应用程序[28]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

 private static final String[] names = { SERVER, CLIENT };

 private static Display display;

 private Form f;

 private ChoiceGroup cg;

 private boolean isPaused;

 private Server server;

 private Client client;

 private Command exitCommand = new Command("Exit", Command.EXIT, 1);

 private Command startCommand = new Command("Start", Command.ITEM, 1);

 public SocketMIDlet() {

  display = Display.getDisplay(this);

  f = new Form("Socket Demo");

  cg = new ChoiceGroup("Please select peer", Choice.EXCLUSIVE, names,

    null);

  f.append(cg);

  f.addCommand(exitCommand);

  f.addCommand(startCommand);

  f.setCommandListener(this);

  display.setCurrent(f);

 }

 public boolean isPaused() {

  return isPaused;

 }

 public void startApp() {

  isPaused = false;

 }

 public void pauseApp() {

  isPaused = true;

 }

 public void destroyApp(boolean unconditional) {

  if (server != null) {

本文关键:J2ME中文教程 7 开发无线网络应用程序
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top