Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Alert


                }

            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


    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

            } 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

            // 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

        } 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

            display.setCurrent(browser);
        } catch (IOException e) {
            //#if debug
            e.printStackTrace();
            //#endif
            Alert alert = new Alert(
                    T._("Error!"),
                    T._("Can't access directory ") + currDirName
                    + "\n" + T._("Exception: ")
                    + e.getMessage(),
                    null, AlertType.ERROR);
            alert.setTimeout(Alert.FOREVER);
            display.setCurrent(alert, oldDisplayable);
        }
    }
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

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.