Package javax.microedition.lcdui

Examples of javax.microedition.lcdui.Display


    }

    public String prompt()
    {
        final Waiter waiter = new Waiter();
        final Display display = Application.getManager().getDisplay();
        final Displayable current = display.getCurrent();
        display.setCurrent( displayable );
        waiter.start();
        try
        {
            waiter.join();
        }
        catch( InterruptedException e )
        {
        }
        if( current != null )
        {
            display.setCurrent( current );
        }
        return cancelled.booleanValue() ? null : getText();
    }
View Full Code Here


    warehouseCanvas.addCommand( helpCommand );
    warehouseCanvas.setCommandListener( this );
  }

  public void startApp() {
    Display display = Display.getDisplay( this );
    display.setCurrent( warehouseCanvas );
  }
View Full Code Here

  public void destroyApp( boolean unconditional ) {
  }

  public void commandAction( Command c, Displayable d ) {
    Display display = Display.getDisplay( this );
    try {
      if( c == quitCommand ) {
        warehouseCanvas.saveGameData();
        notifyDestroyed();
      } else if( c == undoCommand ) {
        warehouseCanvas.undoMove();
      } else if( c == gameCommand ) {
        display.setCurrent( gameList );
      } else if( c == List.SELECT_COMMAND && d == gameList ) {
        String name = gameList.getString( gameList.getSelectedIndex() );
        warehouseCanvas.loadGame( "/warehouse/levels/" + name + ".lev" );
        display.setCurrent( warehouseCanvas );
      } else if( c == levelCommand ) {
        levelField.setString( String.valueOf( warehouseCanvas.getLevel() ) );
        display.setCurrent( levelForm );
      } else if( c == resetCommand ) {
        warehouseCanvas.setLevel( warehouseCanvas.getLevel() );
        display.setCurrent( warehouseCanvas );
      } else if( c == nextCommand ) {
        warehouseCanvas.setLevel( warehouseCanvas.getLevel() + 1 );
        display.setCurrent( warehouseCanvas );
      } else if( c == randomCommand ) {
        warehouseCanvas.randomLevel();
        display.setCurrent( warehouseCanvas );
      } else if( c == clearCommand ) {
        warehouseCanvas.clearGameData();
        warehouseCanvas.setLevel( warehouseCanvas.getLevel() );
        display.setCurrent( warehouseCanvas );
      } else if( c == helpCommand ) {
        display.setCurrent( helpForm );
      } else if( c == okCommand && d == levelForm ) {
        int level = 1;
        try {
          level = Integer.parseInt( levelField.getString() );
        } catch( NumberFormatException e ) {
        }
        warehouseCanvas.setLevel( level );
        display.setCurrent( warehouseCanvas );
      } else if( c == backCommand ) {
        display.setCurrent( warehouseCanvas );
      }
    } catch( Exception e ) {
      display.setCurrent( new Alert( "Error", e.getMessage(), null, null ) );
    }
  }
View Full Code Here

     */
    protected MIDlet() {
        peer = MIDletStateHandler.newMIDletPeer(classSecurityToken, this);

        // Ensure that a display for this midlet is created
        Display d = Display.getDisplay(this);
    }
View Full Code Here

     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();
        Displayable __currentDisplayable = display.getCurrent();
        if (__currentDisplayable != null  &&  nextDisplayable != null) {
            __previousDisplayables.put(nextDisplayable, __currentDisplayable);
        }
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }
    }
View Full Code Here

       
      }
    };
    TextEditor editor = TextEditor.createTextEditor(10, 0, 100, 1);
    editor.setParent(c);
    Display d = Display.getDisplay(this);
    d.setCurrent(c);
    editor.setFocus(true);
    editor.setPosition(10, 10);
    editor.setSize(100, 30);
    editor.setFont(Font.getDefaultFont());
    editor.setBackgroundColor(0xff);
View Full Code Here

        try {
            final SVGImage image = loadSVGImage(SVG_URL);
            final Canvas canvas = new MySVGCanvas(image);

            // Display the canvas
            final Display display = Display.getDisplay(this);
            display.setCurrent(canvas);

            // Add close command
            _mainExit = new Command("Close", Command.EXIT, 1);
            canvas.addCommand(_mainExit);
            canvas.setCommandListener(this);
View Full Code Here

    /**
     * Creates a new MediaKeysDemoMIDlet object
     */
    public MediaKeysDemoMIDlet() {
        final Display display = Display.getDisplay(this);

        final Controllable controllable = (Controllable) display;

        final String mbcName = MediaBehaviourControl.class.getName();
        this._mediaBehaviourControl =
                (MediaBehaviourControl) controllable.getControl(mbcName);

        if (this._mediaBehaviourControl != null) {
            System.out.println("Media Player Mode Enabled Initially: "
                    + this._mediaBehaviourControl.isMediaPlayerModeEnabled());
        } else {
            System.out.println("WARNING: unable to find control: " + mbcName);
        }

        // Display canvas
        final MyCanvas canvas = new MyCanvas();
        display.setCurrent(canvas);

        // Add close command
        _mainExit = new Command("Close", Command.EXIT, 1);
        canvas.addCommand(_mainExit);
        canvas.setCommandListener(this);
View Full Code Here

TOP

Related Classes of javax.microedition.lcdui.Display

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.