confirmui.java

来自「手机通信录程序使用JBuilder2006开发」· Java 代码 · 共 53 行

JAVA
53
字号
package AddressBook;
import javax.microedition.lcdui.*;
import javax.microedition.rms.RecordStore;
/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2008</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class confirmUI implements CommandListener{
  private AddressBookMIDlet addressbook;
  private Display display;
    RecordStore recordStore=null;
  public static final int YES=0;
   public static final int No=1;
   protected Command noCommand;
   protected Command yesCommand;
   private String yesLabel;
   private String noLabel;
    public confirmUI(Display display,AddressBookMIDlet addressbook,
                   String ayesLabel,String anoLabel) {
   //display=Display.getDisplay(this);
   //String ayesLabel;
   //String anoLabel;
   this.addressbook=addressbook;
   this.yesLabel=(yesLabel==null)?"确定":ayesLabel;
   this.noLabel=(noLabel==null)?"返回":anoLabel;
   yesCommand=new Command(yesLabel,Command.OK,1);
   noCommand=new Command(noLabel,Command.CANCEL,1);

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

    Alert alert;
    if(c==yesCommand){
      try{
       alert=new Alert("","确定要删除吗?",null,AlertType.INFO);
      }catch(Exception e){
        e.printStackTrace();
      }
    }
    if(c==noCommand){

    }
  }
}

⌨️ 快捷键说明

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