⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 inputmodehelper.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/* * @(#)InputModeHelper.java	1.5 01/08/12 * 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 com.sun.midp.lcdui;import javax.microedition.lcdui.TextBox;import javax.microedition.lcdui.TextField;/** * A static helper class for InputModes. */public class InputModeHelper {    /** The InputModeClient */    static InputModeClient client;    /**     * Set the InputModeClient for this helper.     *     * @param c The InputModeClient     */    public static void setInputModeHelper(InputModeClient c) {        client = c;    }    /**     * Get the supported input modes.     *     * @return String[] The array of supported input modes     */    public static String[] supportedInputModes() {        return InputMethodHandler.getInputMethodHandler().supportedInputModes();    }    /**     * Set the input mode of the TextBox.     *     * @param tb The TextBox to set the input mode for     * @param defaultMode The default input mode for the TextBox     *     * @see #getMode     */    public static void setMode(TextBox tb, String defaultMode) {        client.setMode(tb, defaultMode);    }    /**     * Get the input mode of the TextBox.     *     * @param tb The TextBox to get the input mode for     * @return String The input mode of the TextBox     *     * @see #setMode     */    public static String getMode(TextBox tb) {        return client.getMode(tb);    }    /**     * Set the set of allowed input modes for the TextBox.     *     * @param tb The TextBox to set the input modes for     * @param allowedMode An array holding the set of input modes     *     * @see #getAllowedModes     */    public static void setAllowedModes(TextBox tb, String[] allowedMode) {        client.setAllowedModes(tb, allowedMode);    }    /**     * Get the set of allowed input modes for the TextBox.     *     * @param tb The TextBox to get the set of input modes for     * @return String[] The set of allowed input modes     *     * @see #setAllowedModes     */    public static String[] getAllowedModes(TextBox tb) {        return client.getAllowedModes(tb);    }    /**     * Set the input mode for the TextField.     *     * @param tf The TextField to set the input mode for     * @param defaultMode The default input mode for the TextField     *     * @see #getMode     */    public static void setMode(TextField tf, String defaultMode) {        client.setMode(tf, defaultMode);    }    /**     * Get the input mode for the TextField.     *     * @param tf The TextField to get the input mode for     * @return String The input mode of the TextField     *      * @see #setMode     */    public static String getMode(TextField tf) {        return client.getMode(tf);    }    /**     * Set the set of allowed input modes for the TextField.     *     * @param tf The TextField to set the input modes for     * @param allowedMode The set of allowed input modes for the TextField     *     * @see #getAllowedModes     */    public static void setAllowedModes(TextField tf, String[] allowedMode) {        client.setAllowedModes(tf, allowedMode);    }    /**     * Get the set of allowed input modes for the TextField.     *     * @param tf The TextField to get the set of allowed input modes for     * @return String[] The set of allowed input modes for the TextField     *     * @see #setAllowedModes     */    public static String[] getAllowedModes(TextField tf) {        return client.getAllowedModes(tf);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -