📄 showdata.java
字号:
import java.io.UnsupportedEncodingException;
import java.util.Calendar;
import javax.microedition.lcdui.Alert;
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.midlet.MIDlet;
public class ShowData extends Form implements CommandListener
{
public Command Command_EXIT=new Command("返回主菜单",Command.EXIT,2);
public Command Command_BACK=new Command("退出全部的系统",Command.CANCEL,1);
public Display display;
public MIDlet pass;
public Alert alert;
public ClassSave MyStore;
private String show;
private LPKeyMask AllOf;
public ShowData(MIDlet pass,LPKeyMask AllOf) {
super("今天的课程安排是");
//try
//{
java.util.Date now=new java.util.Date();
Calendar loCal=Calendar.getInstance();
loCal.setTime(now);
this.AllOf=AllOf;
MyStore=new ClassSave("我的课表的安排");
this.pass=pass;
String Temp=null;
Temp = new String(LPKeyMask.ClassSave1.getRecord(2));//获得你的记录
display=Display.getDisplay(pass);//得到当前的显示
this.addCommand(Command_EXIT);
this.addCommand(Command_BACK);
this.setCommandListener(this);//得到当天的时间,以及星期几
//Show();
;
this.append(" 今天是星期"+loCal.get(Calendar.DAY_OF_WEEK)+" 今天的课表是"+Temp);//后面加入你得到的课程的字符串
// }
//catch(Exception e)
//{
// System.out.println("我这里有 错误的");
//}
}
public void Show()
{
try
{
show=new String(LPKeyMask.ClassSave1.getRecord(1));
}
catch(Exception e)
{
System.out.println("这里是有错误的");
}
}
public void commandAction(Command c, Displayable d) {
// TODO 自动生成方法存根
if(c==Command_EXIT)
{
Display.getDisplay(pass).setCurrent((MainCanvas)AllOf.PicStack.pop());
}
if(c==Command_BACK)
{
pass.notifyDestroyed();
//显示当前的课表的函数。是显示当天的课表
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -