Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Alert


    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


                    os.close();
                    //#ifdef debug
                    System.out.println("DONE");
                    //#endif

                    Alert a = new Alert(T._("Save"), T._("Done"), null, AlertType.INFO);
                    display.setCurrent(a, gobanCanvas);
                } catch (Exception e) {
                    onError(T._("Save"), e);
                }
            }
View Full Code Here

        //#endif
        onError(title, e.toString());
    }

    private void onError(String title, String text) {
        Alert a = new Alert(title, text, null, AlertType.ERROR);
        a.setTimeout(Alert.FOREVER);
        display.setCurrent(a, gobanCanvas);
        //game.board.print();
    }
View Full Code Here

    public void igMenuNextProblem() {
        if (probEnum != null) {
            if (probEnum.hasMoreElements())
                setProblem(probEnum.nextElement());
            else {
                Alert alert = new Alert(T._("Problem solving"),
                        T._("End of enumeration, start with new filter."),
                        null, AlertType.INFO);
                display.setCurrent(alert, menuScreen.getProblemFilterForm());
            }
        }
View Full Code Here

    public void igMenuPrevProblem() {
        if (probEnum != null) {
            if (probEnum.current() > 0)
                setProblem(probEnum.prevElement());
            else {
                Alert alert = new Alert(T._("Problem solving"),
                        T._("Start of enumeration reached."),
                        null, AlertType.INFO);
                display.setCurrent(alert);
            }
        }
View Full Code Here

    public void timeSystemShortOnTime(boolean isBlack, int millisLeft) {
        snd.playShortOnTime();
    }

    public void timeSystemTimeout(boolean isBlack) {
        Alert a = new Alert(T._("Game timer"), (isBlack ? T._("Black") : T._("White")) + T._(" timeout!"), null, AlertType.INFO);
        a.setTimeout(Alert.FOREVER);
        display.setCurrent(a, gobanCanvas);
    }
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

                }

            fc.close();
            display.setCurrent(props);
        } catch (Exception e) {
            Alert alert = new Alert(T._("Error!"), T._("Can't access file ") + fileName
                    + T._(" in directory ") + currDirName + "\n" + T._("Exception: ")
                    + e.getMessage(), null, AlertType.ERROR);
            alert.setTimeout(Alert.FOREVER);
            display.setCurrent(alert);
        }
    }
View Full Code Here

            } else {
                deleteFile(currFile);
                showCurrDir();
            }
        } else {
            Alert cantDeleteFolder = new Alert(
                    T._("Error!"),
                    T._("Can not delete The up-directory (..) symbol! Not a real folder."),
                    null, AlertType.ERROR);
            cantDeleteFolder.setTimeout(Alert.FOREVER);
            display.setCurrent(cantDeleteFolder);
        }
    }
View Full Code Here

        try {
            FileConnection fc = (FileConnection) Connector.open("file:///"
                    + currDirName + fileName);
            fc.delete();
        } catch (Exception e) {
            Alert alert = new Alert(T._("Error!"), T._("Can not access/delete file ")
                    + fileName + T._(" in directory ") + currDirName + "\n"
                    + T._("Exception: ") + e.getMessage(), null, AlertType.ERROR);
            alert.setTimeout(Alert.FOREVER);
            display.setCurrent(alert);
        }
    }
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.