今天还用这个小示例程序给别人讲了次课,发现自己的演讲天赋还是不错的,讲完后闻及感受,说我讲的听通俗易懂的,例子比喻也很不错,开心,呵呵。。。
out.println(this.clientCmd);
this.serverMsg = in.readLine();
strTmp = this.serverMsg.split(spliter);
if(strTmp[0].equals(new String("getbuddys")))
this.creatBuddyList(strTmp); //用服务器传过来的好友数据建列表
private void creatBuddyList(String[] buddys)
DefaultMutableTreeNode buddy = null;
for(int i=1;i<buddys.length;i++)
buddy = new DefaultMutableTreeNode(buddys[i]);
JPanel jPanel1 = new JPanel();
DefaultMutableTreeNode root = new DefaultMutableTreeNode("我的好友");
JTree buddyTree = new JTree(root);
JScrollPane jScrollPane1 = new JScrollPane(buddyTree);
else if(msgTmp[0].equals(new String("getbuddys")))
String clientID = msgTmp[1];//获取客户id号
com.vitamin.DataAccess.DBbase myDb = new DBbase();
this.sql = "select * from buddies where user = "+clientID;
this.rs = myDb.executeQuery(this.sql);
buddyName = rs.getString("buddy");
this.serverMsg += buddyName;
this.out.println(this.serverMsg);
本文转自Phinecos(洞庭散人)博客园博客,原文链接:http://www.cnblogs.com/phinecos/archive/2006/06/22/433350.html,如需转载请自行联系原作者