📄 minicolor.java
字号:
/* * @(#)MiniColor.java 1.9 01/08/21 * Copyright (c) 1999-2001 Sun Microsystems, Inc. All Rights Reserved. * * This software is the confidential and proprietary information of Sun * Microsystems, Inc. ("Confidential Information"). You shall not * disclose such Confidential Information and shall use it only in * accordance with the terms of the license agreement you entered into * with Sun. * * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING * THIS SOFTWARE OR ITS DERIVATIVES. */package example.chooser;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;import example.About;/** * Create a single color chooser MIDlet. It uses the MiniColorChooser * as its main screen. */public class MiniColor extends MIDlet implements CommandListener { /** The display for this MIDlet */ private Display display; /** The MiniColorChooser */ private MiniColorChooser chooser; /** The exit command */ private Command exitCommand = new Command("Exit", Command.EXIT, 1); /** The About command */ private Command aboutCommand = new Command("About", Command.HELP, 2); /** * Create the MiniColor MIDlet. * Create the mini chooser and set the commands and listener. */ public MiniColor() { display = Display.getDisplay(this); chooser = new MiniColorChooser(); chooser.addCommand(exitCommand); chooser.addCommand(aboutCommand); chooser.setCommandListener(this); chooser.setColor(0xffff00); } /** * Create the MiniColor and make it current */ public void startApp() { display.setCurrent(chooser); } /** * Pause */ public void pauseApp() { } /** * Destroy must cleanup everything. * @param unconditional true if the MIDlet must destroy exit */ public void destroyApp(boolean unconditional) { } /** * Respond to a commands issued on any Screen * @param c Command invoked * @param s Displayable on which the command was invoked */ public void commandAction(Command c, Displayable s) { if (c == exitCommand) { destroyApp(true); notifyDestroyed(); } else if (c == aboutCommand) { About.showAbout(display); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -