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

📄 jatext.java

📁 有关j2me的很好的例子可以研究一下
💻 JAVA
字号:
/* * @(#)JaText.java	1.11 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.auction.i18n;import javax.microedition.midlet.*;import javax.microedition.lcdui.*;public class JaText extends MIDlet {    Display display;    TextBox c, d, e;    Command next = new Command("Next", Command.SCREEN, 1);    public void destroyApp(boolean unconditional) {    }    public void pauseApp() {    }    public void startApp() {        display = Display.getDisplay(this);        String str = "";        try {            str = new String(euc_text, 0, euc_text.length, "EUC_JP");        } catch (java.io.UnsupportedEncodingException e) {            str = "EUCJP not supported";        }        d = new TextBox("EUC_JP TEXT", str, 256, TextField.ANY);        d.addCommand(next);        try {            str = new String(sjis_text, 0, sjis_text.length, "SJIS");        } catch (java.io.UnsupportedEncodingException e) {            str = "SJIS not supported";        }        c = new TextBox("SJIS TEXT", str, 256, TextField.ANY);        c.addCommand(next);        try {            str = new String(sjis_text, 0, sjis_text.length, "MS932");        } catch (java.io.UnsupportedEncodingException e) {            str = "MS932 not supported";        }        e = new TextBox("MS932 TEXT", str, 256, TextField.ANY);        e.addCommand(next);        c.setCommandListener(new CommandListener() {            public void commandAction(Command x, Displayable s) {                if (x == next) {                    display.setCurrent(d);                }            }        });        d.setCommandListener(new CommandListener() {            public void commandAction(Command x, Displayable s) {                if (x == next) {                    display.setCurrent(e);                }            }        });        e.setCommandListener(new CommandListener() {            public void commandAction(Command x, Displayable s) {                if (x == next) {                    display.setCurrent(c);                }            }        });        display.setCurrent(d);    }    byte sjis_text[] = {        (byte)0x81, (byte)0x75, (byte)0x82, (byte)0x68, (byte)0x81,         (byte)0x40, (byte)0x82, (byte)0x6b, (byte)0x82, (byte)0x6e,         (byte)0x82, (byte)0x75, (byte)0x82, (byte)0x64, (byte)0x81,         (byte)0x40, (byte)0x82, (byte)0x78, (byte)0x82, (byte)0x6e,         (byte)0x82, (byte)0x74, (byte)0x81, (byte)0x76, (byte)0x82,         (byte)0xcc, (byte)0x95, (byte)0xcf, (byte)0x8e, (byte)0xed,         (byte)0x82, (byte)0xc6, (byte)0x82, (byte)0xdd, (byte)0x82,         (byte)0xe7, (byte)0x82, (byte)0xea, (byte)0x82, (byte)0xe9,         (byte)0x83, (byte)0x45, (byte)0x83, (byte)0x43, (byte)0x83,         (byte)0x8b, (byte)0x83, (byte)0x58, (byte)0x82, (byte)0xaa,         (byte)0x8c, (byte)0xa9, (byte)0x82, (byte)0xc2, (byte)0x82,         (byte)0xa9, (byte)0x82, (byte)0xc1, (byte)0x82, (byte)0xbd,         (byte)0x81, (byte)0x42, (byte)0x83, (byte)0x81, (byte)0x81,         (byte)0x5b, (byte)0x83, (byte)0x8b, (byte)0x82, (byte)0xcc,         (byte)0x8c, (byte)0x8f, (byte)0x96, (byte)0xbc, (byte)0x82,         (byte)0xaa, (byte)0x8c, (byte)0x88, (byte)0x82, (byte)0xdc,         (byte)0x82, (byte)0xc1, (byte)0x82, (byte)0xc4, (byte)0x82,         (byte)0xa2, (byte)0x82, (byte)0xc8, (byte)0x82, (byte)0xa2,         (byte)0x82, (byte)0xbd, (byte)0x82, (byte)0xdf, (byte)0x81,         (byte)0x41, (byte)0x94, (byte)0xbb, (byte)0x95, (byte)0xca,         (byte)0x82, (byte)0xaa, (byte)0x93, (byte)0xef, (byte)0x82,         (byte)0xb5, (byte)0x82, (byte)0xa2, (byte)0x81, (byte)0x42,         (byte)0x28, (byte)0x30, (byte)0x30, (byte)0x3a, (byte)0x32,         (byte)0x31, (byte)0x29, (byte)0x20,     };    byte euc_text[] = {        (byte)0xbb, (byte)0xca, (byte)0xcb, (byte)0xa1, (byte)0xbe,         (byte)0xca, (byte)0xa4, (byte)0xc8, (byte)0x4d, (byte)0x69,         (byte)0x63, (byte)0x72, (byte)0x6f, (byte)0x73, (byte)0x6f,         (byte)0x66, (byte)0x74, (byte)0xa4, (byte)0xce, (byte)0xc6,         (byte)0xc8, (byte)0xb6, (byte)0xd8, (byte)0xcb, (byte)0xa1,         (byte)0xc1, (byte)0xca, (byte)0xbe, (byte)0xd9, (byte)0xa4,         (byte)0xc7, (byte)0xa1, (byte)0xa4, (byte)0xbb, (byte)0xca,         (byte)0xcb, (byte)0xa1, (byte)0xbe, (byte)0xca, (byte)0xc2,         (byte)0xa6, (byte)0xa4, (byte)0xcf, (byte)0x32, (byte)0x36,         (byte)0xc6, (byte)0xfc, (byte)0xa1, (byte)0xa4, (byte)0xb2,         (byte)0xfe, (byte)0xc4, (byte)0xfb, (byte)0xb8, (byte)0xe5,         (byte)0xa4, (byte)0xce, (byte)0xc0, (byte)0xa7, (byte)0xc0,         (byte)0xb5, (byte)0xc1, (byte)0xbc, (byte)0xc3, (byte)0xd6,         (byte)0xb0, (byte)0xc6, (byte)0xa4, (byte)0xf2, (byte)0xcf,         (byte)0xa2, (byte)0xcb, (byte)0xae, (byte)0xc3, (byte)0xcf,         (byte)0xba, (byte)0xdb, (byte)0xa4, (byte)0xcb, (byte)0xc4,         (byte)0xf3, (byte)0xbd, (byte)0xd0, (byte)0xa4, (byte)0xb7,         (byte)0xa4, (byte)0xbf, (byte)0xa1, (byte)0xa3, (byte)0xc6,         (byte)0xe2, (byte)0xcd, (byte)0xc6, (byte)0xa4, (byte)0xcf,         (byte)0xa1, (byte)0xa4, (byte)0xc0, (byte)0xe8, (byte)0xb7,         (byte)0xee, (byte)0xbd, (byte)0xd0, (byte)0xa4, (byte)0xb7,         (byte)0xa4, (byte)0xc6, (byte)0xa4, (byte)0xa4, (byte)0xa4,         (byte)0xbf, (byte)0xb0, (byte)0xc6, (byte)0xa4, (byte)0xcb,         (byte)0xbe, (byte)0xae, (byte)0xa4, (byte)0xb5, (byte)0xa4,         (byte)0xca, (byte)0xbd, (byte)0xa4, (byte)0xc0, (byte)0xb5,         (byte)0xa4, (byte)0xf2, (byte)0xb2, (byte)0xc3, (byte)0xa4,         (byte)0xa8, (byte)0xa4, (byte)0xbf, (byte)0xa4, (byte)0xc0,         (byte)0xa4, (byte)0xb1, (byte)0xa4, (byte)0xce, (byte)0xa4,         (byte)0xe2, (byte)0xa4, (byte)0xce, (byte)0x0a, (byte)0xa4,         (byte)0xc7, (byte)0xa1, (byte)0xa4, (byte)0x33, (byte)0xca,         (byte)0xac, (byte)0xb3, (byte)0xe4, (byte)0xa4, (byte)0xc7,         (byte)0xa4, (byte)0xcf, (byte)0xa4, (byte)0xca, (byte)0xa4,         (byte)0xaf, (byte)0xa1, (byte)0xa4, (byte)0xb0, (byte)0xfa,         (byte)0xa4, (byte)0xad, (byte)0xc2, (byte)0xb3, (byte)0xa4,         (byte)0xad, (byte)0x4d, (byte)0x69, (byte)0x63, (byte)0x72,         (byte)0x6f, (byte)0x73, (byte)0x6f, (byte)0x66, (byte)0x74,         (byte)0xa4, (byte)0xce, (byte)0x32, (byte)0xca, (byte)0xac,         (byte)0xb3, (byte)0xe4, (byte)0xa4, (byte)0xf2, (byte)0xbc,         (byte)0xe7, (byte)0xc4, (byte)0xa5, (byte)0xa4, (byte)0xb7,         (byte)0xa4, (byte)0xc6, (byte)0xa4, (byte)0xa4, (byte)0xa4,         (byte)0xeb, (byte)0xa1, (byte)0xa3, (byte)0xba, (byte)0xa3,         (byte)0xb2, (byte)0xf3, (byte)0xa4, (byte)0xce, (byte)0xb0,         (byte)0xc6, (byte)0xa4, (byte)0xc7, (byte)0xa4, (byte)0xcf,         (byte)0xa1, (byte)0xa4, (byte)0xca, (byte)0xac, (byte)0xb3,         (byte)0xe4, (byte)0xb8, (byte)0xe5, (byte)0xa4, (byte)0xce,         (byte)0xb2, (byte)0xf1, (byte)0xbc, (byte)0xd2, (byte)0xa4,         (byte)0xac, (byte)0xc6, (byte)0xc3, (byte)0xc4, (byte)0xea,         (byte)0xa4, (byte)0xce, (byte)0xc0, (byte)0xbd, (byte)0xc9,         (byte)0xca, (byte)0xa4, (byte)0xf2, (byte)0xa5, (byte)0xe9,         (byte)0xa5, (byte)0xa4, (byte)0xa5, (byte)0xbb, (byte)0xa5,         (byte)0xf3, (byte)0xa5, (byte)0xb9, (byte)0xa4, (byte)0xb7,         (byte)0xb9, (byte)0xe7, (byte)0xa4, (byte)0xa6, (byte)0xa4,         (byte)0xcb, (byte)0xba, (byte)0xdd, (byte)0xa4, (byte)0xb7,         (byte)0xa4, (byte)0xc6, (byte)0xa4, (byte)0xce, (byte)0xbe,         (byte)0xf2, (byte)0xb7, (byte)0xef, (byte)0xa4, (byte)0xf2,         (byte)0xcc, (byte)0xc0, (byte)0xb3, (byte)0xce, (byte)0xb2,         (byte)0xbd, (byte)0xa1, (byte)0xa3,     };}

⌨️ 快捷键说明

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