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

📄 battlechangermidlet.java

📁 j2me 游戏 battle_changer(MOTO)工程。可以参考下。
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html// Decompiler options: packimports(3) fieldsfirst ansi// Source File Name:   BattleChangerMIDlet.javaimport com.nokia.mid.sound.Sound;import java.io.*;import javax.microedition.lcdui.Display;import javax.microedition.lcdui.Image;import javax.microedition.midlet.MIDlet;public class BattleChangerMIDlet extends MIDlet{    private final BattleChanger canvas = new BattleChanger(this);//    private final Sound sound = new Sound(new byte[4], 5);    private final Pool pool = new Pool();    public BattleChangerMIDlet()    {    }    public void startApp()    {        Display.getDisplay(this).setCurrent(canvas);        canvas.start();    }    public void pauseApp()    {        canvas.stop();    }    public void destroyApp(boolean flag)    {        canvas.stop();    }    public void exitRequested()    {        destroyApp(false);        notifyDestroyed();    }    public void playWAV(String s)    {        byte abyte0[] = (byte[])pool.get(s);        if(abyte0 == null)            try            {                InputStream inputstream = getClass().getResourceAsStream("/" + s);                ByteArrayOutputStream bytearrayoutputstream = new ByteArrayOutputStream();                int i;                while((i = inputstream.read()) != -1)                    bytearrayoutputstream.write(i);                abyte0 = bytearrayoutputstream.toByteArray();                pool.put(abyte0, s);            }            catch(Exception exception)            {                System.out.println(s + " is not found..");            }        try        {//            sound.stop();//            sound.init(abyte0, 5);//            sound.setGain(sound.getGain() / 8);//            sound.play(1);        }        catch(IllegalStateException illegalstateexception) { }    }    public Image getImage(String s)    {        Image image = (Image)pool.get(s);        if(image == null)            try            {                image = Image.createImage("/" + s);                pool.put(image, s);            }            catch(IOException ioexception)            {                System.out.println(s + " is not found..");            }        return image;    }}

⌨️ 快捷键说明

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