Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Alert


          if (itemSelected) {
            try {
              openSelected();
            } catch (Throwable t) {
              if (midlet != null) {
                Alert internalAlert = new Alert(
                    "Internal problem",
                    "Internal error.  Unable to open.",
                    null,
                    AlertType.ERROR);
                internalAlert.setTimeout(Alert.FOREVER);
                Display.getDisplay(midlet).setCurrent(
                    internalAlert, this );
              }
              //#ifdef DLOGGING
              logger.severe("KFileSelectorImpl openSelected ", t);
View Full Code Here


            //#ifdef DLOGGING
            logger.severe("openSelected security exception selected:  " + selectedFile, e);
            logger.severe("openSelected root url selected:  " + currentRoot.getURL(), e);
            //#endif
            if (midlet != null) {
              Alert securityAlert = new Alert(
                  "Security problem",
                  "Security problem found either access " +
                  " denied or access refused by the user.",
                  null,
                  AlertType.ERROR);
              securityAlert.setTimeout(Alert.FOREVER);
              Display.getDisplay(midlet).setCurrent(
                  securityAlert, this );
            }
            throw e;
          }
          catch (IllegalArgumentException e)
          {
            if (midlet != null) {
              Alert illegalAlert = new Alert(
                  "Security problem",
                  "Security problem found either access " +
                  " denied or access refused by the user.",
                  null,
                  AlertType.ERROR);
              illegalAlert.setTimeout(Alert.FOREVER);
              Display.getDisplay(midlet).setCurrent(
                  illegalAlert, this );
            }
            //#ifdef DTEST
            if (bDebug) System.out.println("### open file: " + e);
View Full Code Here

          final boolean saveMemoryEnabled =
              m_appSettings.getSaveMemoryEnabled();
          saveBkMrkSettings(saveMemoryEnabled,
              System.currentTimeMillis(),
              true, true, "label.init.d", false);
          Alert m_about = HelpForm.getAbout(this);
          if (m_loadForm.hasExc()) {
            setCurrent( m_about, m_loadForm );
          } else {
            setCurrent( m_about, m_bookmarkList );
          }
View Full Code Here

            }
          } catch (ConnectionNotFoundException e) {
            //#ifdef DLOGGING
//@            logger.severe("Error opening link " + m_platformURL, e);
            //#endif
            final Alert badLink = new Alert("Could not connect to link",
                "Bad link:  " + m_platformURL,
                null, AlertType.ERROR);
            badLink.setTimeout(Alert.FOREVER);
            setCurrent( badLink, m_itemRtnList );
          } finally {
            m_platformReq = false;
          }
        }
        //#endif

        /* Sort the read or unread items. */
        if ( m_runNews ) {
          try {
            /* Sorting items... */
            initializeLoadingFormRsc("text.s.item",
                m_bookmarkList);
            AllNewsList unreadHeaderList = new AllNewsList(this,
              m_bookmarkList, m_rssFeeds,
                  m_appSettings.getMarkUnreadItems() ?
                  m_unreadImage : null,
                  m_appSettings.getMarkUnreadItems() ?
                  m_readImage : null);
            //#ifdef DTESTUI
//@            m_unreadHeaderTestList = unreadHeaderList;
            //#endif
            unreadHeaderList.initializeUnreadHhdrsList();
            unreadHeaderList.sortUnreadItems( true,
                m_bookmarkList, m_rssFeeds );
            setCurrent( unreadHeaderList );
                    }catch(OutOfMemoryError t) {
            System.gc();
            recordExcFormFin("\nOut Of Memory Error sorting items", t);
                    }catch(Throwable t) {
            recordExcFormFin("\nInternal error sorting items", t);
          } finally {
            m_runNews = false;
          }
        }

        if ( m_backFrHdr ) {
          m_backFrHdr = false;
          /* Updating feed... */
          initializeLoadingFormRsc("text.u.feed", m_bookmarkList);
          try {
            m_rssFeeds.put(m_curRssParser.getRssFeed());
          } catch (Throwable t) {
            recordExcFormFin("Internal error updating feed.", t);
          }
          setCurrent( m_bookmarkList );
        }

        if ( m_showItem ) {
          m_showItem = false;
          initializeLoadingFormRsc( "text.l.it", m_itemRtnList );
          RssItunesFeed feed = m_curRssParser.getRssFeed();
          citem.setUnreadItem(false);
          initializeItemForm( feed, citem, m_itemRtnList );
          //#ifdef DTESTUI
//@          m_itemNext = true;
          //#endif
        }

        if ( m_exit || m_saveBookmarks
          //#ifdef DTEST
//@             || m_testSaveBookmarks
          //#endif
        ) {
          if ( m_exit ) {
            /* Exiting saving data... */
            initializeLoadingFormRsc("text.exit", m_bookmarkList);
          } else {
            /* Saving data... */
            initializeLoadingFormRsc("text.savd", m_bookmarkList);
          }
          exitApp();
        }

                lngStart = System.currentTimeMillis();
                lngTimeTaken = System.currentTimeMillis()-lngStart;
                if(lngTimeTaken<100L) {
          synchronized(this) {
            if (!m_needWakeup) {
              super.wait(75L-lngTimeTaken);
            }
            m_needWakeup = false;
          }
        }
            } catch (InterruptedException e) {
                break;
            } catch (Throwable t) {
        try {
          if (m_loadForm == null) {
            synchronized(this) {
              if (m_loadForm == null) {
                /* Processing... */
                initializeLoadingFormRsc("text.proc",
                    m_bookmarkList);
              }
            }
          }
          recordExcForm("Internal error while processing", t);
        } catch (Throwable e) {
          t.printStackTrace();
          final Alert internalAlert = new Alert(
              /* Internal error */
              ResourceProviderME.get("exc.int.err"),
              /* Internal error while processing */
              ResourceProviderME.get("exc.int.proc"),
              null,
              AlertType.ERROR);
          internalAlert.setTimeout(Alert.FOREVER);
          setCurrent( internalAlert );
        }
            }
        }
    }
View Full Code Here

    //#endif
    return super.append(si);
  }
   
  public void run() {
    Alert about = HelpForm.getAbout(m_midlet);
    m_midlet.setCurrent( about, this );
  }
View Full Code Here

   * Create about alert.
   * @author  Irving Bunton
   * @version 1.0
   */
  final public static Alert getAbout(MIDlet midlet) {
    final Alert about = new Alert(ResourceProviderME.get(
          "alert.about.title"), ResourceProviderME.get("alert.about",
midlet.getAppProperty("MIDlet-Version") + "-" +
midlet.getAppProperty("Program-Version")), null, AlertType.INFO);
    about.setTimeout(Alert.FOREVER);
    return about;
  }
View Full Code Here

          (String)promptCommands.get(origCmd)));
    Command okCmd = UiUtil.getCmdRsc("cmd.ok", Command.OK, 1);
    formAlert.addCommand(okCmd);
    Command cancelCmd = UiUtil.getCmdRsc("cmd.cancel", Command.CANCEL, 2);
    formAlert.addCommand(cancelCmd);
    promptAlert = new Alert(origCmd.getLabel(),
        ((StringItem)formAlert.get(ix)).getText(), question,
        AlertType.CONFIRMATION);
    promptAlert.setTimeout(Alert.FOREVER);
    promptAlert.addCommand(okCmd);
    promptAlert.addCommand(cancelCmd);
View Full Code Here

       mid.getLCD().setCurrent(this);
   }

   private void showError(String msg) {

        Alert a = new Alert("Error", msg, null, AlertType.ERROR);
        a.setTimeout(3000);
        mid.getLCD().setCurrent(a, this);
   }
View Full Code Here

    }
    private void playTone()  {
        try {
            Manager.playTone(64, 1000, 100);
        } catch (MediaException ex) {
            alr = new Alert("Error", "Can't play tone", null, AlertType.ERROR);
            alr.setTimeout(Alert.FOREVER);
            mDisplay.setCurrent(alr);
        }

View Full Code Here


    }
    private void AlarmText(int whichOne) {
        alr = null;
        alr = new Alert(LocalizationSupport.getMessage("WARNING"),timesNames[whichOne]+" "+LocalizationSupport.getMessage("SALATTIME"), null, AlertType.INFO);
        alr.setTimeout(Alert.FOREVER);
        mDisplay.setCurrent(alr);

    }
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.