Implementing the InfoScreen class

This is a simple utility screen to display exceptions and alerts.

To create the class:

  1. Assign the class to the package satsa and import the required classes.

    package satsa;
    
    import javax.microedition.lcdui.Alert;
    import javax.microedition.lcdui.AlertType;
    import javax.microedition.lcdui.Display;
  2. Create the class by extending Alert.

    class InfoScreen
      extends Alert
    {
      InfoScreen()
      {
        super("InfoScreen");
      }
    
      void showError(String message, Display display)
      {
        setTitle("Error");
        setType(AlertType.ERROR);
        setTimeout(5000);
        setString(message);
        display.setCurrent(this);
      }