KickJava   Java API By Example, From Geeks To Geeks.

Java > Java SE, EE, ME > javax > microedition > lcdui > Command

javax.microedition.lcdui
Class Command

java.lang.Object
  |
  +--javax.microedition.lcdui.Command
See Also:
Top Examples, Source Code, STOP, SCREEN, OK, ITEM, HELP, EXIT, CANCEL, BACK, CommandListener

public static final int BACK
See Also:
STOP, CANCEL, commandAction
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


[289]MIDlet display example
By Anonymous on 2003/06/27 09:52:24  Rate
// Ticker - "pop-up" message 
  
  
 import javax.microedition.midlet.*; 
 import javax.microedition.lcdui.*; 
  
  
 public class HelloMIDlet extends  MIDlet  
              implements CommandListener  {  
   private Command exitCommand;  
   private Display display;     
   private Ticker hi = new Ticker (  "J2ME is cool"  ) ; 
  
  
   public HelloMIDlet (  )   {  
     display = Display.getDisplay (  this  ) ; 
     exitCommand = new Command (  "Exit", Command.SCREEN, 2  ) ; 
    }  
  
  
   public void startApp (  )   {  
     TextBox t = new TextBox (  "Hello MIDlet",  
       "Wireless Internet", 256, 0  ) ; 
     t.addCommand (  exitCommand  ) ; 
     t.setCommandListener (  this  ) ; 
     t.setTicker (  hi  ) ; // set the ticker 
     display.setCurrent (  t  ) ; 
    }  
   public void pauseApp (  )   {   }  
   public void destroyApp (  boolean unconditional  )   {   }  
   public void commandAction (  Command c, Displayable s  )   {  
     if  ( c == exitCommand )   {  
       destroyApp (  false  ) ; 
       notifyDestroyed (  ) ; 
  }   }   }  
  
  
   
 //BACK


public static final int CANCEL
See Also:
STOP, BACK, commandAction
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Command(String label,
               int commandType,
               int priority)
See Also:
Command(String, String, int, int)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public Command(String shortLabel,
               String longLabel,
               int commandType,
               int priority)
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int EXIT
See Also:
commandAction
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getCommandType()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getLabel()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public String getLongLabel()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public int getPriority()
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int HELP
See Also:
commandAction
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int ITEM
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int OK
See Also:
CANCEL, commandAction
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int SCREEN
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  


public static final int STOP
See Also:
CANCEL, BACK, commandAction
Geek's Notes:
Description  Add your codes or notes  Search More Java Examples  

Popular Tags