📄 noteview.java
字号:
package com.cnxinshe.noteview;
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.Form;
import javax.microedition.lcdui.List;
import javax.microedition.lcdui.TextField;
public class NoteView implements CommandListener {
private String filePath="";
private Command exitCommand01 =new Command("exitCommand01",Command.SCREEN,1);
private Command exitCom01=new Command("exitCom01",Command.SCREEN,1);
private Display display;
List l=new List("超级阅读--小说",Choice.IMPLICIT); //定义一个List对象l
private Command exitCom = new Command("exitCom", Command.SCREEN, 1);
public NoteView(Display display,String path) {
super();
// TODO Auto-generated constructor stub
//System.out.println("++++:" + strContent);
this.display=display;
this.filePath=path;
this.startApp();
}
public String startApp() {
// TODO Auto-generated method stub
ReaderFile rfe = new ReaderFile();
//FileManage fm=new FileManage();
//Form f = new Form("超级阅读"); // 创建一个Form对象f
String strContent= rfe.myReadLine(filePath); // 读取test1.txt文件中的内容返回字符串
//String strContent= rfe.read_UTF(filePath);
// byte [] myByte= rfe.readFile(filePath);
//String strContent="";
//try {
//
// strContent = new String (myByte,"utf-8");
//} catch (Exception e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
//}
String s = System.getProperty("microedition.encoding");
System.out.println("++++:"+s);
//
// f.append(strContent); // 将文本文件的内容加入到f对象中
// f.addCommand(exitCom); // 将退出按钮选项加入到f对象中
// f.setCommandListener(this); // 注册高级事件处理
//display.setCurrent(f); // 将f对象显示到手机屏幕上
return s;
}
public void commandAction(Command c, Displayable s) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -