Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Alert


            // only empty directory can be deleted
            if (!content.hasMoreElements()) {
                fcdir.delete();
                showCurrDir();
            } else {
                Alert cantDeleteFolder = new Alert(T._("Error!"),
                        T._("Can not delete The non-empty folder: ") + folderName,
                        null, AlertType.ERROR);
                cantDeleteFolder.setTimeout(Alert.FOREVER);
                display.setCurrent(cantDeleteFolder);
            }
        } catch (IOException ioe) {
            //#ifdef debug
            //System.out.println(currDirName + folderName);
View Full Code Here


        } catch (Exception e) {
            String s = T._("Can not create file ") + newName;
            if (e.getMessage() != null && e.getMessage().length() > 0) {
                s += "\n" + e;
            }
            Alert alert = new Alert(T._("Error!"), s, null, AlertType.ERROR);
            alert.setTimeout(Alert.FOREVER);
            display.setCurrent(alert);
            // Restore the commands that were removed in commandAction()
            display.getCurrent().addCommand(newOkCommand);
            display.getCurrent().addCommand(upCommand);
        }
View Full Code Here

        long mainTime = Integer.parseInt(newGameMainTime.getString()) * 1000;
        long byoYomiTime = Integer.parseInt(newGameByoYomiTime.getString()) * 1000;
        int byoYomiAttr = Integer.parseInt(newGameByoYomiAttr.getString());

        if (alertText.length() > 0) {
            Alert alert = new Alert(T._("Error!"), alertText.toString(), null, AlertType.ERROR);
            alert.setTimeout(Alert.FOREVER);
            display.setCurrent(alert);
        } else
            listener.mainMenuNewGame(white, black, ruleSet, size, handicap, komi, timeSystem, mainTime, byoYomiTime, byoYomiAttr);
    }
View Full Code Here

        } catch (Exception x) {
            probError(T._("Unable to enumerate records!"), x, null);
            return;
        }
        if (e == null || !e.hasMoreElements()) {
            Alert alert = new Alert(T._("Problem solving"),
                    T._("Empty set, try widening criteria."),
                    null, AlertType.INFO);
            display.setCurrent(alert);
        } else
            listener.mainMenuSolveProblems(e);
View Full Code Here

        new Thread(new Runnable() {
            public void run() {
                try {
                    int n = pdb.addPath(path, true);
                    probUpdateFromPDB();
                    Alert alert = new Alert(T._("Add Path"), T._("") + n + T._(" problems added"), null, AlertType.INFO);
                    alert.setTimeout(Alert.FOREVER);
                    display.setCurrent(alert, goBack());
                } catch (Exception e) {
                    probError(T._("Unable to add path!"), e, goBack());
                }
            }
View Full Code Here

    void probError(String msg, Exception e, Displayable d) {
        //#if debug
        e.printStackTrace();
        //#endif
        Alert alert = new Alert(T._("Problem DB error!"), msg + T._("\n") + e.toString(),
                null, AlertType.ERROR);
        alert.setTimeout(Alert.FOREVER);
        if (d == null)
            display.setCurrent(alert);
        else
            display.setCurrent(alert, d);
    }
View Full Code Here

        long mainTime = Integer.parseInt(newGameMainTime.getString()) * 1000;
        long byoYomiTime = Integer.parseInt(newGameByoYomiTime.getString()) * 1000;
        int byoYomiAttr = Integer.parseInt(newGameByoYomiAttr.getString());

        if (alertText.length() > 0) {
            Alert alert = new Alert(T._("Error!"), alertText.toString(), null, AlertType.ERROR);
            alert.setTimeout(Alert.FOREVER);
            display.setCurrent(alert);
        } else
            listener.mainMenuNewGame(white, black, ruleSet, size, handicap, komi, timeSystem, mainTime, byoYomiTime, byoYomiAttr);
    }
View Full Code Here

        } catch (Exception x) {
            probError(T._("Unable to enumerate records!"), x, null);
            return;
        }
        if (e == null || !e.hasMoreElements()) {
            Alert alert = new Alert(T._("Problem solving"),
                    T._("Empty set, try widening criteria."),
                    null, AlertType.INFO);
            display.setCurrent(alert);
        } else
            listener.mainMenuSolveProblems(e);
View Full Code Here

        } else if (c == newCommand) {
            createFile();
        } else if (c == newOkCommand) {
            String newName = nameInput.getString();
            if (newName == null || newName.length() == 0) {
                Alert alert = new Alert(T._("Error!"),
                        T._("File Name is empty. Please provide file name."), null,
                        AlertType.ERROR);
                alert.setTimeout(Alert.FOREVER);
                display.setCurrent(alert);
            } else {
                // Create file in a separate thread and disable all commands
                // except for "cancel"
                display.getCurrent().removeCommand(newOkCommand);
View Full Code Here

        new Thread(new Runnable() {
            public void run() {
                try {
                    int n = pdb.addPath(path, true);
                    probUpdateFromPDB();
                    Alert alert = new Alert(T._("Add Path"), T._("") + n + T._(" problems added"), null, AlertType.INFO);
                    alert.setTimeout(Alert.FOREVER);
                    display.setCurrent(alert, goBack());
                } catch (Exception e) {
                    probError(T._("Unable to add path!"), e, goBack());
                }
            }
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.Alert

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.