FileDocCategorySizeDatePackage
MiniColor.javaAPI DocJ2ME MIDP 2.01916Thu Nov 07 12:02:16 GMT 2002example.chooser

MiniColor

public class MiniColor extends MIDlet implements CommandListener
Create a single color chooser MIDlet. It uses the MiniColorChooser as its main screen.

Fields Summary
private Display
display
The display for this MIDlet
private MiniColorChooser
chooser
The MiniColorChooser
private Command
exitCommand
The exit command
private Command
aboutCommand
The About command
Constructors Summary
public MiniColor()
Create the MiniColor MIDlet. Create the mini chooser and set the commands and listener.


                       
      
	display = Display.getDisplay(this);
	chooser = new MiniColorChooser();
	
	chooser.addCommand(exitCommand);
	chooser.addCommand(aboutCommand);
	chooser.setCommandListener(this);

	chooser.setColor(0xffff00);
    
Methods Summary
public voidcommandAction(Command c, Displayable s)
Respond to a commands issued on any Screen

param
c Command invoked
param
s Displayable on which the command was invoked

	if (c == exitCommand) {
	    destroyApp(true);
	    notifyDestroyed();
	} else if (c == aboutCommand) {
	    About.showAbout(display);
	}
    
public voiddestroyApp(boolean unconditional)
Destroy must cleanup everything.

param
unconditional true if the MIDlet must destroy exit

    
public voidpauseApp()
Pause

    
public voidstartApp()
Create the MiniColor and make it current

	display.setCurrent(chooser);