本文整理汇总了Java中javax.microedition.lcdui.AlertType.INFO属性的典型用法代码示例。如果您正苦于以下问题:Java AlertType.INFO属性的具体用法?Java AlertType.INFO怎么用?Java AlertType.INFO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类javax.microedition.lcdui.AlertType
的用法示例。
在下文中一共展示了AlertType.INFO属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showLoginRequiredMessage
/**
* Show a login required message on the screen.
*
* @param title
* @param alertText
* @param type
*/
public final void showLoginRequiredMessage() {
Alert alert = new Alert(LOGIN_REQUIRED_LABEL, LOGIN_REQUIRED_TEXT,
null, AlertType.INFO);
alert.addCommand(new Command(LOGIN_REQUIRED_YES, Command.OK, 0));
alert.addCommand(new Command(LOGIN_REQUIRED_NO, Command.CANCEL, 0));
alert.setCommandListener(new CommandListener() {
public void commandAction(Command c, Displayable d) {
if(c.getCommandType() == Command.OK) {
showLoginView();
} else {
setDisplay(self);
}
}
});
setDisplay(alert);
}
示例2: commandAction
public void commandAction(Command cmd, Displayable disp) {
//#debug info
System.out.println("commandAction with cmd=" + cmd.getLabel() + ", screen=" + disp );
if (cmd == this.backCommand) {
display.setCurrent(mainScreen);
} else if (cmd == this.exitCommand) {
//#debug info
System.out.println("Exit application");
this.notifyDestroyed();
} else if (cmd == this.aboutCommand) {
String param = this.getAppProperty("Xfolite-Version");
Alert alert = new Alert(
Locale.get("main.label.about"),
Locale.get("main.msg.about", param),
null,
AlertType.INFO);
// Looks like an error but builds
this.display.setCurrent(alert, mainScreen);
}
}
示例3: inquiryCompleted
public void inquiryCompleted(int complete) {
log("device discovery is completed with return code:" + complete);
log("" + devices.size() + " devices are discovered");
deviceReturnCode = complete;
if (devices.size() == 0) {
Alert alert = new Alert("Bluetooth", "No Bluetooth device found", null, AlertType.INFO);
alert.setTimeout(3000);
remotedeviceui.showui();
display.setCurrent(alert, remotedeviceui);
} else {
remotedeviceui.showui();
display.setCurrent(remotedeviceui);
}
}
示例4: test
public void test(TestHarness th) {
Alert alert = new Alert("Hello World", "Some text", null, AlertType.INFO);
alert.setTimeout(Alert.FOREVER);
TextEditor textEditor = TextEditor.createTextEditor("Hello, world!", 20, 0, 100, 24);
textEditor.setParent(this);
th.setScreenAndWait(this);
textEditor.setFocus(true);
th.check(textEditor.hasFocus(), "TextEditor gained focus");
th.check(isTextEditorReallyFocused(), "TextEditor really gained focus");
th.setScreenAndWait(alert);
try {
Thread.sleep(500);
} catch (InterruptedException e) {
th.fail("Unexpected exception: " + e);
}
th.check(textEditor.hasFocus(), "TextEditor kept focus");
th.check(!isTextEditorReallyFocused(), "TextEditor really lost focus");
th.setScreenAndWait(this);
th.check(textEditor.hasFocus(), "TextEditor maintained focus");
th.check(isTextEditorReallyFocused(), "TextEditor really regained focus");
th.setScreenAndWait(alert);
th.check(textEditor.hasFocus(), "TextEditor still has focus");
th.check(!isTextEditorReallyFocused(), "TextEditor really lost focus");
}
示例5: showMessage
public void showMessage(String msg) {
//#debug info
System.out.println("Showing message: " + msg);
//#style xformsmessage
Alert alert = new Alert(Locale.get("forms.label.message"),
msg, null, AlertType.INFO);
// Looks like an error but builds
m_display.setCurrent(alert, this);
// FIXME: Implement proper popup
/*
* final Popup popup = new Popup(Pic.get("/info.png"),
* "Message", msg); popup.setCommands(this, Popup.OK, null);
* Screen.get().push(popup);
*/
}
示例6: showResultImage
private void showResultImage()
{
try {
img = Image.createImage("/img/" + result + ".png");
} catch (IOException e) {
throw new JSimpleDiceException(EXCEPTION_MSG + e.getMessage());
}
Alert alert = new Alert(String.valueOf(result), null, img,
AlertType.INFO);
alert.setTimeout(Alert.FOREVER);
display.setCurrent(alert, form);
}