Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Alert


                                                             false));
                    new MultiPlayerManager(mid, name).getDataListener().
                                           addConnetion(con);
                } catch (IOException ex) {

                    Alert conError = new Alert("xUno ME", "Connection server error.", null,
                                         AlertType.WARNING);
                    conError.setTimeout(3000);
                    mid.getLCD().setCurrent(conError, out);
                }
            }
        }.start();
    }
View Full Code Here


    else
      setView(previousView);
  }

  protected void quit() {
    Alert alert = new Alert("${quit}?","${quit.or.restart}?",null, AlertType.CONFIRMATION);
    alert.addCommand(new ActionCommand("${quit}", Command.BACK, 1){
      public Navigation execute(Displayable d) throws Exception {
        midlet.notifyDestroyed();
        return null;
      }           
    });
    alert.addCommand(new ActionCommand("${restart}", Command.OK, 2){
      public Navigation execute(Displayable d) throws Exception {
        start();
        return null;
      }     
    });
View Full Code Here

    setView(alert);
  }

  public void show(Exception ex) {
    ex.printStackTrace();
    Alert alert = new Alert("${error}");
    alert.setString(ex+(ex.getMessage() == null ? "" : ":"+ex.getMessage()));
    alert.setType(AlertType.ERROR);
    alert.setTimeout(Alert.FOREVER);
    alert.addCommand(new ActionCommand("${OK}", Command.OK, 1){
      public Navigation execute(Displayable d) throws Exception {
        back();
        return null;
      }     
    });
    alert.addCommand(new ActionCommand("${quit}", Command.BACK, 1){
      public Navigation execute(Displayable d) throws Exception {
        midlet.notifyDestroyed();
        return null;
      }           
    });
View Full Code Here

    Display.getDisplay(this).setCurrent(fileListControl);
  }

  private void displayError(String message)
  {
    Alert alert = new Alert("Error", message, null, AlertType.ERROR);
    Display.getDisplay(this).setCurrent(alert);
  }
View Full Code Here

        return new Page(new HistoryModel(NFPControler.this), new HistoryView());
      }
    });   
    pages.put("confirm-overwrite", new LazyInit() {
      public Page create() {
        return new Page(new ConfirmOverwriteModel(), new Alert("${confirm}"));
      }
    });
    pages.put("save-observation", new LazyInit() {
      public Page create() {
        return new Page(new SaveObservationModel(NFPControler.this), new Alert("${information}"));
      }
    });
    pages.put("mucus-editor", new LazyInit() {
      public Page create() {
        return new Page(new MucusListModel(NFPControler.this),
View Full Code Here

    private boolean firstStart = true;

    public void startApp() {
        // Don't request the foreground on the first startApp call.
        if (!firstStart) {
            Alert a = new Alert("MIDlet 1");
            a.setTimeout(Alert.FOREVER);
            Display.getDisplay(this).setCurrent(a);
        }

        firstStart = false;
    }
View Full Code Here

* A dummy MIDlet that displays set its current displayable to an alert when
* active and sets its displayable to null when paused.
*/
public class DummyMIDlet2 extends MIDlet {
    public void startApp() {
        Alert a = new Alert("MIDlet 2");
        a.setTimeout(Alert.FOREVER);
        Display.getDisplay(this).setCurrent(a);
    }
View Full Code Here

        Date start = new Date(alarmTime.getTime() +  alarmMinutes * 60000);

        String alarmText = new CalendarDate(start).formatShort() + "\n" +
                           new TimeOfDay(start).toString() + "\n" +
                           itemTitle;
        Alert alarm = new Alert(alarmText);
        alarm.setTimeout(Alert.FOREVER);
        alarm.setType(AlertType.ALARM);
        DisplayController.playSound(AlertType.ALARM);
        DisplayController.setCurrentScreen(alarm);
    }
View Full Code Here

    }

    public Alert getInvalidCredsAlert() {
        if(invalidCredsAlert == null)
        {
            invalidCredsAlert = new Alert("Login Error", "Invalid username or password!", null, AlertType.WARNING);
            invalidCredsAlert.setTimeout(2000);
        }
        return invalidCredsAlert;
    }
View Full Code Here

    public Alert getErrorAlert(String info)
    {
        if(errorAlert == null)
        {
            errorAlert = new Alert("Error", info , null, AlertType.WARNING);
            errorAlert.addCommand(getLoginAgainCmd());
            errorAlert.addCommand(getCancelLoginCmd());
            errorAlert.setCommandListener(this);
        }
        return errorAlert;
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.