当前位置: 首页>>代码示例>>Java>>正文


Java Alert.setTimeout方法代码示例

本文整理汇总了Java中javax.microedition.lcdui.Alert.setTimeout方法的典型用法代码示例。如果您正苦于以下问题:Java Alert.setTimeout方法的具体用法?Java Alert.setTimeout怎么用?Java Alert.setTimeout使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.microedition.lcdui.Alert的用法示例。


在下文中一共展示了Alert.setTimeout方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: inquiryCompleted

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
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);
	}

}
 
开发者ID:cli,项目名称:worldmap-classic,代码行数:19,代码来源:BLUElet.java

示例2: showEaster

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
private void showEaster()
{
    if (easter > 99) {
        easter = 0;
        try {
            Image[] images = new Image[2];
            images[0] = Image.createImage(IMG_TREASURE);
            images[1] = Image.createImage(IMG_TREASURE2);
            Animation ac = new Animation(images, getDisplay());
            Alert alert = new Alert(" You found a treasure!", null, null,
                    AlertType.ALARM);
            alert.setTimeout(5000);
            display.setCurrent(alert, ac);
            ac.addCommand(homeCommand);
            ac.setCommandListener(this);
            ac.startAnimation();
        } catch (IOException e) {
            throw new JSimpleDiceException(EXCEPTION_MSG + e.getMessage());
        }
    }
}
 
开发者ID:camila,项目名称:sf-java,代码行数:22,代码来源:JSimpleDiceMIDlet.java

示例3: showFatalErrorAndQuit

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
public void showFatalErrorAndQuit() {
    Alert alert = new Alert("Fatal Error!", Log.getLogContent(), null, AlertType.ERROR);
    alert.setTimeout(Alert.FOREVER);
    javax.microedition.lcdui.Display.getDisplay(this).setCurrent(alert);
    alert.setCommandListener(new CommandListener() {
        public void commandAction(javax.microedition.lcdui.Command command, Displayable displayable) {
            synchronized (this){
                this.notify();
            }
        }
    });
    try {
        synchronized (this){
            this.wait();
        }
    } catch (InterruptedException e) {
    }
    this.destroyApp(true);
}
 
开发者ID:csperle,项目名称:KeePassMobile,代码行数:20,代码来源:KeePassMobileMIDlet.java

示例4: test

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
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");
}
 
开发者ID:mozilla,项目名称:pluotsorbet,代码行数:30,代码来源:TestAlert.java

示例5: startApp

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
protected void startApp() throws MIDletStateChangeException {
	try {
		System.out.println("FileConnection " + System.getProperty("microedition.io.file.FileConnection.version"));
		this.list.setDir(null);
		setCurrentDisplayable(this.list);
	} catch (SecurityException e) {
		Alert alert = new Alert("Error",  "Unable to access the restricted API", null, AlertType.ERROR);
        alert.setTimeout(Alert.FOREVER);
        setCurrentDisplayable(alert);
	}
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:12,代码来源:FCViewMIDlet.java

示例6: showResultImage

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
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);
}
 
开发者ID:camila,项目名称:sf-java,代码行数:13,代码来源:JSimpleDiceMIDlet.java

示例7: showError

import javax.microedition.lcdui.Alert; //导入方法依赖的package包/类
private void showError(String message) {
	Alert alert = new Alert("Error", message, null, AlertType.ERROR);
	alert.setTimeout(Alert.FOREVER);
	FCViewMIDlet.setCurrentDisplayable(alert);
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:6,代码来源:FilesList.java


注:本文中的javax.microedition.lcdui.Alert.setTimeout方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。