zoukankan      html  css  js  c++  java
  • Screan对象

    import javax.microedition.lcdui.Choice;
    import 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 screemObject extends MIDlet implements CommandListener {
    
        Display display = null;
        public screemObject() {
            super();
        }
    
        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 {
            display=Display.getDisplay(this);
            List l=new List("List test",Choice.EXCLUSIVE);
            l.append("语文",null);
            l.append("数学", null);
            l.append("英语", null);
            l.setSelectedIndex(1, true);
            l.addCommand(new Command("确定",Command.OK,1));
            l.setCommandListener((CommandListener) this);
            display.setCurrent(l);
        }
        public void commandAction(Command c,Displayable d)
        {
            String cmd = c.getLabel();
            if(cmd.equals("确定"));
            {
                List l = (List)d;
                int i = l.getSelectedIndex();
                System.out.println("你选择了第 "+i+" 个选项");
                String con = l.getString(i);
                System.out.println("选项的名称为 "+ con);
            }
        }
    
    }
  • 相关阅读:
    再读《赤壁赋》念《滕王阁序》
    赤壁赋
    关于C语言中的位域
    Eliot
    cnblogs.com博客园简介
    springboot+thymeleaf 实现图片文件上传及回显
    绑定事件的方式
    无法获得 VMCI 驱动程序的版本: 句柄无效。
    Connection is read-only解决方式
    Java 线程的 5 种状态
  • 原文地址:https://www.cnblogs.com/wangchunming/p/2451432.html
Copyright © 2011-2022 走看看