锘??xml version="1.0" encoding="utf-8" standalone="yes"?>精品久久一区二区三区蜜桃,色999久久久精品人人澡69,久久精品国产色蜜蜜麻豆http://www.aygfsteel.com/s-jqzhang/archive/2008/12/01/243787.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Mon, 01 Dec 2008 12:28:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/12/01/243787.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/243787.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/12/01/243787.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/243787.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/243787.htmlimport java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.io.Connector;
import javax.microedition.io.ServerSocketConnection;
import javax.microedition.io.SocketConnection;
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.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class Client extends MIDlet  implements CommandListener {
 
 

 private DataInputStream dis=null;
 private DataOutputStream dos=null;
 private ServerSocketConnection ssc=null;
 //private StreamConnection sc=null;
 private SocketConnection sc=null;
 private TextField msg=null;
 private Form frm=null;
 private Command cmdSend=null;
 private StringItem imsg=null;
 
 protected void startApp() throws MIDletStateChangeException {
  
  frm=new Form("瀹㈡埛绔?);
  cmdSend=new Command("鍙戦?,Command.OK,1);
  msg=new TextField("璇瘋緭鍏ヤ綘鐨勪俊鎭?,"",255,TextField.ANY);
  frm.append(msg);
  frm.addCommand(cmdSend);
  frm.setCommandListener(this);
  Display.getDisplay(this).setCurrent(frm);
  
  
  try {
   sc=(SocketConnection)Connector.open("socket://127.0.0.1:9999");
   //sc=ssc.acceptAndOpen();
   dis=sc.openDataInputStream();
   dos=sc.openDataOutputStream();
   Chat chat=new Chat();
   chat.start();
   
  } catch (IOException e) {
  
   e.printStackTrace();
  }
  

 }
 

 public void commandAction(Command c, Displayable d) {
  if(c==cmdSend)
  {
   try {
    dos.writeUTF(msg.getString()+"\n");
   } catch (IOException e) {
    // TODO Auto-generated catch block
    System.out.println(e.getMessage()+"\n");
   }
   msg.setString("");
  }
  
  
 }

 protected void destroyApp(boolean b) throws MIDletStateChangeException {
  

 }

 protected void pauseApp() {
 

 }
 
 class Chat extends Thread
 {
  public void run()
  {
   while(true)
   {
    
     try {
      imsg=new StringItem(dis.readUTF(),"");
      frm.insert(1, imsg);
    
   } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
   }
   
   
  }
 }

 
 

 

}



]]>
j2me 鍩轟簬Socket鐨勭畝鍗曡亰澶╂湇鍔$http://www.aygfsteel.com/s-jqzhang/archive/2008/12/01/243786.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Mon, 01 Dec 2008 12:28:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/12/01/243786.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/243786.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/12/01/243786.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/243786.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/243786.htmlimport java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import javax.microedition.io.Connector;
import javax.microedition.io.ServerSocketConnection;
import javax.microedition.io.SocketConnection;
import javax.microedition.io.StreamConnection;
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.lcdui.StringItem;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class Server extends MIDlet  implements CommandListener {
 
 

 private DataInputStream dis=null;
 private DataOutputStream dos=null;
 private ServerSocketConnection ssc=null;
 //private StreamConnection sc=null;
 private SocketConnection sc=null;
 private TextField msg=null;
 private Form frm=null;
 private Command cmdSend=null;
 private StringItem imsg=null;
 
 protected void startApp() throws MIDletStateChangeException {
  
  frm=new Form("鏈嶅姟鍣?);
  cmdSend=new Command("鍙戦?,Command.OK,1);
  msg=new TextField("璇瘋緭鍏ヤ綘鐨勪俊鎭?,"",255,TextField.ANY);
  frm.append(msg);
  frm.addCommand(cmdSend);
  frm.setCommandListener(this);
  Display.getDisplay(this).setCurrent(frm);
  
  
  try {
   ssc=(ServerSocketConnection)Connector.open("socket://:9999");
   sc=(SocketConnection)ssc.acceptAndOpen();
   dis=sc.openDataInputStream();
   dos=sc.openDataOutputStream();
   Chat chat=new Chat();
   chat.start();
   
  } catch (IOException e) {
  
   e.printStackTrace();
  }
  

 }
 

 public void commandAction(Command c, Displayable d) {
  if(c==cmdSend)
  {
   try {
    dos.writeUTF(msg.getString()+"\n");
   } catch (IOException e) {
    // TODO Auto-generated catch block
    System.out.println(e.getMessage()+"\n");
   }
   msg.setString("");
  }
  
  
 }

 protected void destroyApp(boolean b) throws MIDletStateChangeException {
  

 }

 protected void pauseApp() {
 

 }
 
 class Chat extends Thread
 {
  public void run()
  {
   while(true)
   {
    
     try {
      imsg=new StringItem( dis.readUTF(),"");
      frm.insert(1, imsg);
   } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
   }
   }
   
   
  }
 }

 
 

 

}



]]>
j2me妯℃嫙鐭俊http://www.aygfsteel.com/s-jqzhang/archive/2008/11/28/243207.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Fri, 28 Nov 2008 05:06:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/28/243207.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/243207.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/28/243207.html#Feedback1http://www.aygfsteel.com/s-jqzhang/comments/commentRss/243207.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/243207.htmlimport 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.lcdui.Item;
import javax.microedition.lcdui.ItemStateListener;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class MessageMIDlet extends MIDlet {

 
 private welcome wcfrm=null;
 
 public MessageMIDlet() {

 }

 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {


 }

 protected void pauseApp() {
 

 }

 protected void startApp() throws MIDletStateChangeException {
 
  wcfrm=new welcome(this);
  Display.getDisplay(this).setCurrent(wcfrm);
 }

}

class welcome extends Form implements CommandListener
{

 
    private Command cmdExit=null;
    private Command cmdWrite=null;
    private writemsg wrfrm=null;
    private MIDlet let=null;
   
    public welcome(MIDlet mlet)
    {
     super("嬈㈣繋浣跨敤鏈▼搴?);
     let=mlet;
 
     cmdExit=new Command("閫鍑?,Command.EXIT,1);
     cmdWrite=new Command("鍐欑煭淇?,Command.SCREEN,1);
     this.addCommand(cmdExit);
     this.addCommand(cmdWrite);
     this.setCommandListener(this);
     
    }
 public void commandAction(Command c, Displayable d) {
 
   if(c==cmdExit)
   {
  
    let.notifyDestroyed();
   }
   else
    if(c==cmdWrite)
    {
     wrfrm=new writemsg(let);
     Display.getDisplay(let).setCurrent(wrfrm);
   
    
    }
 
 }

}
class writemsg extends javax.microedition.lcdui.Form implements CommandListener,ItemStateListener
{
 

 private Command cmdBack=null;
 private Command cmdwrNum=null;
 private MIDlet let=null;
 private TextField tf=null;
 private Command cmdDel=null;
 private writeNum2 wrnum=null;
 
 

 public writemsg(MIDlet mlet)
 {
 
  super("璇瘋緭鍏ョ煭淇″唴瀹?);
  let=mlet;
  cmdBack=new Command("榪斿洖",Command.EXIT,1);
  cmdwrNum=new Command("鍙戦?,Command.SCREEN,1);
  cmdDel=new Command("鍒犻櫎",Command.EXIT,1);
  this.addCommand(cmdBack);
  this.addCommand(cmdwrNum);
 
  tf= new  TextField("","",255,TextField.ANY);
  //tf.addCommand(cmdDel);
  this.append(tf);
  this.setItemStateListener(this);
  this.setCommandListener(this);
  tf.setLayout(TextField.LAYOUT_VEXPAND);
 }
 
 public void commandAction(Command c, Displayable d) {
 
  if(c==cmdBack)
  {
   Display.getDisplay(let).setCurrent(new welcome(let));
  
  }else if(c==cmdwrNum)
  {
  wrnum=new  writeNum2(let);
   Display.getDisplay(let).setCurrent(wrnum);
  
  }else if(c==cmdDel)
  {
   int p=tf.getCaretPosition();
   if(p>0)
   {
    tf.delete(p-1, 1);
   }
   if(tf.getString().length()==0)
   {
      this.removeCommand(cmdDel);
      this.addCommand(cmdBack);
   
   }
  
  }

 
 }

 public void itemStateChanged(Item i) {
 
  if(i==tf)
  {
    if( tf.getString().length()>0)
    {
    // this.addCommand(cmdDel);
     this.removeCommand(cmdBack);
     this.addCommand(cmdDel);
    }
    else
    {
     this.removeCommand(cmdDel);
     this.addCommand(cmdBack);
    }
  
  
  }
 
 
 }
 
 
}

 

class writeNum2 extends javax.microedition.lcdui.Form implements CommandListener,ItemStateListener
{
 

 private Command cmdBack=null;
 private Command cmdwrNum=null;
 private MIDlet let=null;
 private TextField tf=null;
 private Command cmdDel=null;
 private Form preFrm=null;
 private boolean sendflag=false;

 
 

 public writeNum2(MIDlet mlet)
 {
 
  super("璇瘋緭鍏ュ鏂瑰彿鐮?);
  let=mlet;
  preFrm=(Form) Display.getDisplay(let).getCurrent();
  cmdBack=new Command("榪斿洖",Command.EXIT,1);
  cmdwrNum=new Command("鍙戦?,Command.SCREEN,1);
  cmdDel=new Command("鍒犻櫎",Command.EXIT,1);
  this.addCommand(cmdBack);
  this.addCommand(cmdwrNum);
 
  tf= new  TextField("","",13,TextField.NUMERIC);
  //tf.addCommand(cmdDel);
  this.append(tf);
  this.setItemStateListener(this);
  this.setCommandListener(this);
 
 }
 
 public void commandAction(Command c, Displayable d) {
 
  if(c==cmdBack)
  {
  if (sendflag)
  Display.getDisplay(let).setCurrent(new welcome(let));
  else
   Display.getDisplay(let).setCurrent(this.preFrm);
  
  }else if(c==cmdwrNum)
  {

    String msg= ((TextField)(preFrm.get(0))).getString();
    String phonenum= tf.getString();
   
    this.append("淇℃伅鍐呭:"+ msg);
    this.append("鍙戦佸彿鐮?"+ phonenum);
    this.append("鍙戦佺姸鎬?鎴愬姛");
    this.delete(0);
    this.removeCommand(cmdwrNum);
    this.removeCommand(cmdDel);
    this.addCommand(cmdBack);
    sendflag=true;
  }else if(c==cmdDel)
  {
   int p=tf.getCaretPosition();
   if(p>0)
   {
    tf.delete(p-1, 1);
   }
   if(tf.getString().length()==0)
   {
      this.removeCommand(cmdDel);
      this.addCommand(cmdBack);
   
   }
  
  }

 
 }


 public void itemStateChanged(Item i) {
 
  if(i==tf)
  {
    if( tf.getString().length()>0)
    {
    // this.addCommand(cmdDel);
     this.removeCommand(cmdBack);
     this.addCommand(cmdDel);
    }
    else
    {
     this.removeCommand(cmdDel);
     this.addCommand(cmdBack);
    }
  
  
  }
 
 
 }
 
 
}

/*

class writeNum extends Form implements CommandListener
{

 private MIDlet let=null;
 private Command cmdSend=null;
 private Command cmdBack=null;
 private TextField num=null;
 private Form backfrm=null;
 public writeNum(MIDlet mlet) {
 
  super("璇瘋緭鍏ヨ鍙戦佺殑鍙風(fēng)爜");
  let=mlet;
  num=new TextField("","",13,TextField.NUMERIC);
  this.append(num);
  cmdSend=new Command("鍙戦?,Command.OK,1);
  cmdBack=new Command("榪斿洖",Command.BACK,1);
  this.addCommand(cmdSend);
  this.addCommand(cmdBack);
  this.backfrm=(Form) Display.getDisplay(let).getCurrent();
  this.setCommandListener(this);
 
 
 }

 public void commandAction(Command c, Displayable d) {
  if(c==cmdSend)
  {
   try
   {
    String msg=((TextField)this.backfrm.get(0)).getString();//褰撹法鍑犱釜Form鏃跺簲璇ユ庝箞鍔?
    this.append("淇℃伅:"+ msg+"宸插彂閫佸埌:"+ num.getString());
  
   this.delete(0);
   this.setTitle("淇℃伅宸插彂閫佹垚鍔?);
   }
   catch(Exception e)
   {
    this.append("淇℃伅鎴愬姛鍙戦?);
   }
  }
  else if(c==cmdBack)
  {
   Display.getDisplay(let).setCurrent(this.backfrm);
  }
 
 
 }
 
}
**/

 



]]>
J2me 涓涓皬緇冧範(fàn)(鐭俊妯℃嫙)http://www.aygfsteel.com/s-jqzhang/archive/2008/11/28/243121.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Thu, 27 Nov 2008 16:04:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/28/243121.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/243121.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/28/243121.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/243121.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/243121.htmlimport 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.lcdui.Item;
import javax.microedition.lcdui.ItemStateListener;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class MessageMIDlet extends MIDlet {

 
 private welcome wcfrm=null;
 
 public MessageMIDlet() {

 }

 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {


 }

 protected void pauseApp() {
 

 }

 protected void startApp() throws MIDletStateChangeException {
 
  wcfrm=new welcome(this);
  Display.getDisplay(this).setCurrent(wcfrm);
 }

}

class welcome extends Form implements CommandListener
{

 
    private Command cmdExit=null;
    private Command cmdWrite=null;
    private writemsg wrfrm=null;
    private MIDlet let=null;
   
    public welcome(MIDlet mlet)
    {
     super("嬈㈣繋浣跨敤鏈▼搴?);
     let=mlet;
 
     cmdExit=new Command("閫鍑?,Command.EXIT,1);
     cmdWrite=new Command("鍐欑煭淇?,Command.SCREEN,1);
     this.addCommand(cmdExit);
     this.addCommand(cmdWrite);
     this.setCommandListener(this);
     
    }
 public void commandAction(Command c, Displayable d) {
 
   if(c==cmdExit)
   {
  
    let.notifyDestroyed();
   }
   else
    if(c==cmdWrite)
    {
     wrfrm=new writemsg(let);
     Display.getDisplay(let).setCurrent(wrfrm);
   
    
    }
 
 }

}
class writemsg extends javax.microedition.lcdui.Form implements CommandListener,ItemStateListener
{
 

 private Command cmdBack=null;
 private Command cmdwrNum=null;
 private MIDlet let=null;
 private TextField tf=null;
 private Command cmdDel=null;
 private writeNum wrnum=null;
 
 

 public writemsg(MIDlet mlet)
 {
 
  super("璇瘋緭鍏ョ煭淇″唴瀹?);
  let=mlet;
  cmdBack=new Command("榪斿洖",Command.EXIT,1);
  cmdwrNum=new Command("鍙戦?,Command.SCREEN,1);
  cmdDel=new Command("鍒犻櫎",Command.EXIT,1);
  this.addCommand(cmdBack);
  this.addCommand(cmdwrNum);
 
  tf= new  TextField("","",255,TextField.ANY);
  //tf.addCommand(cmdDel);
  this.append(tf);
  this.setItemStateListener(this);
  this.setCommandListener(this);
 
 }
 
 public void commandAction(Command c, Displayable d) {
 
  if(c==cmdBack)
  {
   Display.getDisplay(let).setCurrent(new welcome(let));
  
  }else if(c==cmdwrNum)
  {
   wrnum=new writeNum(let);
   Display.getDisplay(let).setCurrent(wrnum);
  
  }else if(c==cmdDel)
  {
   int p=tf.getCaretPosition();
   if(p>0)
   {
    tf.delete(p-1, 1);
   }
   if(tf.getString().length()==0)
   {
      this.removeCommand(cmdDel);
      this.addCommand(cmdBack);
   
   }
  
  }

 
 }

 public void itemStateChanged(Item i) {
 
  if(i==tf)
  {
    if( tf.getString().length()>0)
    {
    // this.addCommand(cmdDel);
     this.removeCommand(cmdBack);
     this.addCommand(cmdDel);
    }
    else
    {
     this.removeCommand(cmdDel);
     this.addCommand(cmdBack);
    }
  
  
  }
 
 
 }
 
 
}

class writeNum extends Form implements CommandListener
{

 private MIDlet let=null;
 private Command cmdSend=null;
 private Command cmdBack=null;
 private TextField num=null;
 private writemsg backfrm=null;
 public writeNum(MIDlet mlet) {
 
  super("璇瘋緭鍏ヨ鍙戦佺殑鍙風(fēng)爜");
  let=mlet;
  num=new TextField("","",13,TextField.NUMERIC);
  this.append(num);
  cmdSend=new Command("鍙戦?,Command.OK,1);
  cmdBack=new Command("榪斿洖",Command.BACK,1);
  this.addCommand(cmdSend);
  this.addCommand(cmdBack);
  this.backfrm=(writemsg) Display.getDisplay(let).getCurrent();
  this.setCommandListener(this);
 
 
 }

 public void commandAction(Command c, Displayable d) {
  if(c==cmdSend)
  {
   try
   {
    String msg=((TextField)this.backfrm.get(0)).getString();//褰撹法鍑犱釜Form鏃跺簲璇ユ庝箞鍔?
    this.append("淇℃伅:"+ msg+"宸插彂閫佸埌:"+ num.getString());
  
   this.delete(0);
   this.setTitle("淇℃伅宸插彂閫佹垚鍔?);
   }
   catch(Exception e)
   {
    this.append("淇℃伅鎴愬姛鍙戦?);
   }
  }
  else if(c==cmdBack)
  {
   Display.getDisplay(let).setCurrent(this.backfrm);
  }
 
 
 }
 
}

 



]]>
J2me ItemStateListenerhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/27/242917.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Thu, 27 Nov 2008 00:49:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/27/242917.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/242917.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/27/242917.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/242917.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/242917.htmlimport 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.lcdui.Item;
import javax.microedition.lcdui.ItemCommandListener;
import javax.microedition.lcdui.ItemStateListener;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class MIDletItemCommmandListener extends MIDlet implements ItemCommandListener,CommandListener,ItemStateListener {
                                                              
 
 private Form frm=new Form("Item鐩戝惉鍣?);
 private TextField uid=new TextField("鐢ㄦ埛鍚?,"",20,TextField.ANY);
 private TextField pwd=new TextField("瀵嗙爜","",20,TextField.PASSWORD);
 private Display dis=Display.getDisplay(this);
 private Command Del=new Command("鍒犻櫎",Command.ITEM,1);
 
 public MIDletItemCommmandListener() {
  
 }

 protected void startApp() throws MIDletStateChangeException {
  
  
  
  frm.append(uid);
  uid.addCommand(Del);
  pwd.addCommand(Del);
  pwd.setItemCommandListener(this);
  uid.setItemCommandListener(this);
  frm.append(pwd);
  dis.setCurrent(frm);
  dis.setCurrentItem(pwd);
  frm.setItemStateListener(this);
  


 }
 
 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
 

 }

 protected void pauseApp() {
  

 }

 public void commandAction(Command c, Item i) {
  
  if(c==Del)
  {
   TextField tf=(TextField)i;
   
   int p=tf.getCaretPosition();
   if(p>0)
   {
   tf.delete(p-1, 1);
   }
  }
 
  
 }

 public void commandAction(Command c, Displayable d) {
  
  
 }

 public void itemStateChanged(Item i) {
  
    if(i==uid)
    {
     frm.setTitle("鐢ㄦ埛鍚?+uid.getString());
    } else if(i==pwd)
    {
     frm.setTitle("瀵嗙爜"+uid.getString());
    }
  
 }

 

}



]]>
J2Me ItemCommandListener http://www.aygfsteel.com/s-jqzhang/archive/2008/11/27/242915.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Thu, 27 Nov 2008 00:34:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/27/242915.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/242915.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/27/242915.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/242915.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/242915.htmlimport 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.lcdui.Item;
import javax.microedition.lcdui.ItemCommandListener;
import javax.microedition.lcdui.TextField;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

public class MIDletItemCommmandListener extends MIDlet implements ItemCommandListener,CommandListener {
                                                              
 
 private Form frm=new Form("Item鐩戝惉鍣?);
 private TextField uid=new TextField("鐢ㄦ埛鍚?,"",20,TextField.ANY);
 private TextField pwd=new TextField("瀵嗙爜","",20,TextField.PASSWORD);
 private Display dis=Display.getDisplay(this);
 private Command Del=new Command("鍒犻櫎",Command.ITEM,1);
 
 public MIDletItemCommmandListener() {
  // TODO Auto-generated constructor stub
 }

 protected void startApp() throws MIDletStateChangeException {
  
  
  
  frm.append(uid);
  uid.addCommand(Del);
  pwd.addCommand(Del);
  pwd.setItemCommandListener(this);
  uid.setItemCommandListener(this);
  frm.append(pwd);
  dis.setCurrent(frm);
  dis.setCurrentItem(pwd);
  


 }
 
 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
  // TODO Auto-generated method stub

 }

 protected void pauseApp() {
  

 }

 public void commandAction(Command c, Item i) {
  
  if(c==Del)
  {
   TextField tf=(TextField)i;
   
   int p=tf.getCaretPosition();
   if(p>0)
   {
   tf.delete(p-1, 1);
   }
  }
 
  
 }

 public void commandAction(Command c, Displayable d) {
  
  
 }

 

}



]]>
J2Me List Image Fonthttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242722.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Wed, 26 Nov 2008 01:54:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242722.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/242722.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242722.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/242722.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/242722.htmlimport javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Font;
import javax.microedition.lcdui.Image;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class ListImage extends MIDlet {
 
 
 private List list;
 private Display dis;

 public ListImage() {
  // TODO Auto-generated constructor stub
 }

 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
  // TODO Auto-generated method stub

 }

 protected void pauseApp() {
  // TODO Auto-generated method stub

 }

 protected void startApp() throws MIDletStateChangeException {
  
  
  list=new List("鍒楄〃",List.MULTIPLE);
  Image img=null;
  try
  {
   
  img=Image.createImage("/mlogo.PNG");
  
  
  }
  catch(Exception e)
  {
   System.out.println("Error");
  }
  list.append("鍥劇墖", img);
  Font f=null;
  f=Font.getFont(Font.FACE_MONOSPACE,Font.STYLE_UNDERLINED, Font.SIZE_LARGE);
  list.setFont(0, f);
  dis=Display.getDisplay(this);
  dis.setCurrent(list);
  // TODO Auto-generated method stub

 }

}



]]>
J2me List Multiplehttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242716.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Wed, 26 Nov 2008 01:35:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242716.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/242716.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242716.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/242716.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/242716.htmlimport javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class MIDlet3 extends MIDlet implements CommandListener  {
 
 private List list=null;
 
 private Command cmdOk=null;
 
 private Display dis=null;

 public MIDlet3() {
  // TODO Auto-generated constructor stub
 }

 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
  // TODO Auto-generated method stub

 }

 protected void pauseApp() {
  // TODO Auto-generated method stub

 }

 protected void startApp() throws MIDletStateChangeException {
  
    cmdOk=new Command("紜畾",Command.OK,1);
   
    list=new List("璇烽夋嫨",List.MULTIPLE);
  
  for(int i=0;i<10;i++)
  {
   list.append("鍒楄〃"+i, null);
   
  }
  list.addCommand(cmdOk);
  dis=Display.getDisplay(this);
  list.setCommandListener(new Operater());
  dis.setCurrent(list);
  // TODO Auto-generated method stub

 }

 public void commandAction(Command c, Displayable d) {
    //Method1
  int size=list.size();
  for(int i=0;i<size;i++)
  {
   if(list.isSelected(i))
   {
    System.out.print(list.getString(i));
   }
  }
  //Method 2
  /*
  boolean[] Flags=new boolean[list.size()];
     list.getSelectedFlags(Flags);
     for(int i=0;i<list.size();i++)
     {
      if(Flags[i])
      {
       System.out.print(list.getString(i));
      }
     }
     */
  
 }

}

 

 



]]>
J2me List Multiplehttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242710.html寮犵敓宸ヤ綔瀹?/dc:creator>寮犵敓宸ヤ綔瀹?/author>Wed, 26 Nov 2008 00:52:00 GMThttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242710.htmlhttp://www.aygfsteel.com/s-jqzhang/comments/242710.htmlhttp://www.aygfsteel.com/s-jqzhang/archive/2008/11/26/242710.html#Feedback0http://www.aygfsteel.com/s-jqzhang/comments/commentRss/242710.htmlhttp://www.aygfsteel.com/s-jqzhang/services/trackbacks/242710.htmlimport javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.List;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;


public class MIDlet3 extends MIDlet implements CommandListener  {
 
 private List list=null;
 
 private Command cmdOk=null;
 
 private Display dis=null;

 public MIDlet3() {
  // TODO Auto-generated constructor stub
 }

 protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
  // TODO Auto-generated method stub

 }

 protected void pauseApp() {
  // TODO Auto-generated method stub

 }

 protected void startApp() throws MIDletStateChangeException {
  
    cmdOk=new Command("紜畾",Command.OK,1);
   
    list=new List("璇烽夋嫨",List.MULTIPLE);
  
  for(int i=0;i<10;i++)
  {
   list.append("鍒楄〃"+i, null);
   
  }
  //list.addCommand(cmdOk);
  
  list.setCommandListener(new Operater());
  dis.setCurrent(list);
  // TODO Auto-generated method stub

 }

 public void commandAction(Command c, Displayable d) {
    //Method1
  int size=list.size();
  for(int i=0;i<size;i++)
  {
   if(list.isSelected(i))
   {
    System.out.print(list.getString(i));
   }
  }
  //Method 2
  boolean[] Flags=new boolean[list.size()];
     list.getSelectedFlags(Flags);
     for(int i=0;i<list.size();i++)
     {
      if(Flags[i])
      {
       System.out.print(list.getString(i));
      }
     }
  
 }

}

 

 



]]>
主站蜘蛛池模板: 信宜市| 黄龙县| 建水县| 无棣县| 醴陵市| 张家口市| 永靖县| 南京市| 壤塘县| 墨江| 靖宇县| 丰镇市| 光山县| 中牟县| 靖江市| 汶上县| 清流县| 宣威市| 赤水市| 稻城县| 内黄县| 莆田市| 怀柔区| 阳原县| 堆龙德庆县| 游戏| 荥阳市| 宁强县| 上虞市| 台江县| 武城县| 定西市| 浦城县| 改则县| 巴林左旗| 中方县| 山丹县| 大同市| 普兰店市| 福清市| 孟津县|