⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 choosefiledialog.java

📁 在j2me手机上显示调整图片色板
💻 JAVA
字号:
package barontools.changethecolor;

import javax.microedition.lcdui.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2007</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class ChooseFileDialog implements CommandListener{
  Command apply;
  ChangeTheColorCanvas parent;
  List fileList;
  public ChooseFileDialog(String string, String[] files,ChangeTheColorCanvas ctcc) {
   // super(string);
    fileList=new List("选择图片",List.IMPLICIT,files,null);
    apply=new Command("确认",1,Command.OK);
    fileList.addCommand(apply);
    fileList.setCommandListener(this);
    parent=ctcc;
  }

//  /**
//   * commandAction
//   *
//   * @param command Command
//   * @param item Item
//   */
//  public void commandAction(Command command, Item item) {
//    if(command.getLabel()=="确认"){
//      try{
//        Image img=Image.createImage("/res/"+item.getLabel());
//        parent.ibPanel.setImage(img);
//      }catch(Exception e){
//        e.printStackTrace();
//      }
//      Display.getDisplay(parent.mainMIDlet).setCurrent(parent);
//    }
//  }

  /**
   * commandAction
   *
   * @param command Command
   * @param displayable Displayable
   */
  public void commandAction(Command command, Displayable displayable) {
    if (command.getLabel() == "确认") {
      try {
//        System.out.println("/res/" +
//                           fileList.getString(fileList.getSelectedIndex()));
        parent.flashImageData("/res/" +
                              fileList.getString(fileList.getSelectedIndex()));
      }
      catch (Exception e) {
        e.printStackTrace();
      }
      Display.getDisplay(parent.mainMIDlet).setCurrent(parent);
      parent.updateCanvas();
    }
  }

}

⌨️ 快捷键说明

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