?? textfielddemo.java
字號(hào):
/* * @(#)TextFieldDemo.java 1.5 03/01/22 * * Copyright (c) 2000-2003 Sun Microsystems, Inc. All rights reserved. * PROPRIETARY/CONFIDENTIAL * Use is subject to license terms */package textfield;import javax.microedition.midlet.MIDlet;import javax.microedition.lcdui.*;/** * The text field demo displays all of the text field types on the screen * allowing the user to edit them at will. * * @version 2.0 */public class TextFieldDemo extends MIDlet implements CommandListener { private Command exitCommand = new Command("Exit", Command.EXIT, 1); private boolean firstTime; private Form mainForm; public TextFieldDemo() { firstTime = true; mainForm = new Form("Text Field"); } protected void startApp() { if(firstTime) { mainForm.append("This demo contains text fields each one " + "with a different constraint"); mainForm.append(new TextField("Any Character", "", 15, TextField.ANY)); mainForm.append(new TextField("E-Mail", "", 15, TextField.EMAILADDR)); mainForm.append(new TextField("Number", "", 15, TextField.NUMERIC)); mainForm.append(new TextField("Decimal", "", 15, TextField.DECIMAL)); mainForm.append(new TextField("Phone", "", 15, TextField.PHONENUMBER)); mainForm.append(new TextField("Password", "", 15, TextField.PASSWORD)); mainForm.append(new TextField("URL", "", 15, TextField.URL)); mainForm.addCommand(exitCommand); mainForm.setCommandListener(this); firstTime = false; } Display.getDisplay(this).setCurrent(mainForm); } public void commandAction(Command c, Displayable s) { if (c == exitCommand) { destroyApp(false); notifyDestroyed(); } } protected void destroyApp(boolean unconditional) { } protected void pauseApp() { }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -