📄 notify_alery.java
字号:
import javax.microedition.lcdui.Alert;
import javax.microedition.lcdui.AlertType;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Image;
/*
* Created on 2006-2-18
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
/**
* @author blrc
*
* TODO To change the template for this generated type comment go to
* Window - Preferences - Java - Code Style - Code Templates
*/
public class Notify_Alery extends Alert implements CommandListener {
private Command ACCEPT_COMMAND;
private Command REJECT_COMMAND;
MainMIDlet adaptee;
public Notify_Alery(MainMIDlet adaptee) {
super("Alert","someone wants to invite you!",null,AlertType.INFO);
setTimeout(Alert.FOREVER);
this.adaptee = adaptee;
ACCEPT_COMMAND = new Command("accept",Command.OK,0);
REJECT_COMMAND = new Command("reject",Command.CANCEL,0);
addCommand(ACCEPT_COMMAND);
addCommand(REJECT_COMMAND);
setCommandListener(this);
}
public void commandAction(Command c, Displayable d) {
if (c == ACCEPT_COMMAND)
{
adaptee.accept_invite();
}
else if (c == REJECT_COMMAND)
{
adaptee.deney_invite();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -