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

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

本文简介:

    }

    if (c == -1) {

     break;

    }

    // Display message to user

    si.setText("Message received - " + sb.toString());

   }

   stop();

   si.setText("Connection closed");

   f.removeCommand(sendCommand);

  } catch (ConnectionNotFoundException cnfe) {

   Alert a = new Alert("Client", "Please run Server MIDlet first",

     null, AlertType.ERROR);

   a.setTimeout(Alert.FOREVER);

   a.setCommandListener(this);

   display.setCurrent(a);

  } catch (IOException ioe) {

   if (!stop) {

    ioe.printStackTrace();

   }

  } catch (Exception e) {

   e.printStackTrace();

  }

 }

 public void commandAction(Command c, Displayable s) {

  if (c == sendCommand && !parent.isPaused()) {

   sender.send(tf.getString());

  }

  if ((c == Alert.DISMISS_COMMAND) || (c == exitCommand)) {

   parent.notifyDestroyed();

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

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

go top