?? meetnotice.java
字號:
/*
* MeetNotice.java
*
*/
import javax.microedition.lcdui.*;
import javax.microedition.rms.RecordEnumeration;
import javax.microedition.rms.RecordFilter;
import javax.microedition.rms.RecordStore;
public class MeetNotice extends Form implements CommandListener {
private DataSave dataSave;
private Container container;
private Jianhuaban midlet;
private Displayable displayable;
private Display display;
private StringItem si;
private MyCommand myc;
private Command backCommand;
private String meetNoticeID;
private String meetNoticeContent;
private RecordEnumeration re = null;
private RecordStore rs = null;
private String adid=null;
// private int i=2;
//好像是上邊的構造函數 11-28日
public MeetNotice(Jianhuaban midlet,Displayable displayable,Container container,DataSave dataSave) {
super("aaa");
myc=new MyCommand();
this.midlet=midlet;
this.displayable=displayable;
si=new StringItem("會議公告","");
append(si);
backCommand=new Command("back",Command.BACK,1);
this.addCommand(backCommand);
this.addCommand(myc.getUpCommand());
this.addCommand(myc.getDownCommand());
this.addCommand(myc.getDisplay());
setCommandListener(this);
this.display=Display.getDisplay(midlet);
this.container=container;
this.dataSave=dataSave;
}
public void commandAction(Command c ,Displayable d){
dataSave.openTheStore("meetNotice");
String sb=new String();
int i=dataSave.getCurrentID();
if(backCommand==c){
display.setCurrent(displayable);
}
if(c==myc.getDisplay()){
//要加上 調試時屏蔽的
//
sb=dataSave.getTheStore(dataSave,"meetNotice",i,container);
si.setText(sb);
}
if(c==myc.getDownCommand()){
i++;
sb=dataSave.getTheStore(dataSave,"meetNotice",i,container);
si.setText(sb);
}if(c==myc.getUpCommand()){
i--;
sb=dataSave.getTheStore(dataSave,"meetNotice",i,container);
si.setText(sb);
}
}
//感覺這個方法是沒有必要的 11月27日注
/*
private void readMeetNotice(){
// 下邊的程序是FindRecord.java類的一段程序
//獲取廣告的ID,tf的作用
RecordFilter rf = new FindFilter(meetNoticeID);
RecordEnumeration re = null;
try {
re = rs.enumerateRecords(rf, null, false);
} catch (Exception e) {
}
//查找成功
if (re.numRecords() > 0) {
Container container=null;
int recordID;
try {
byte[] rec;
recordID = re.nextRecordId();
rec = rs.getRecord(recordID);
container=Container.deserializeMeetNotice(rec);
StringItem adContain=new StringItem("廣告內容",container.getMeetNoticeContent());
adContain.setLayout(Item.LAYOUT_NEWLINE_AFTER);
append(adContain);
container = null;
re.destroy();
} catch (Exception e) {
container = null;
}
}
}
*/
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -