您好,欢迎来到[编程问答]网站首页   源码下载   电子书籍   软件下载   专题
当前位置:首页 >> 编程问答 >> Java >> j2me小应用程序 有兴趣的进

j2me小应用程序 有兴趣的进

来源:网络整理     时间:2016/6/22 12:23:26     关键词:

关于网友提出的“ j2me小应用程序 有兴趣的进”问题疑问,本网通过在网上对“ j2me小应用程序 有兴趣的进”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:

问题: j2me小应用程序 有兴趣的进
描述:

做一个有界面切换的应用小程序 如星座测试。健康测试啥的。。。。。本人菜鸟,不知道怎么入手。。。。。求代码。。最好有注释。。。。不胜感激


解决方案1:

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import java.util.*;
import java.io.*;
public class  SuDoKuMIDlet  extends MIDlet  
{
 
    private MenuList menuList;
    private SuDoKuCanvas myCanvas;
    private Alert alert = null;
    public SuDoKuMIDlet() 
    {
    	    	
    }
    
    public void startApp()
    {    
        Displayable current = Display.getDisplay(this).getCurrent();
        if (current == null)
        {
            // first time we've been called
            Display.getDisplay(this).setCurrent(new SplashScreen(this));         }
    }
    public void menuListNewGame()
    {         Display.getDisplay(this).setCurrent(myCanvas);         myCanvas.startNewGame();
        myCanvas.start();
    }
/>     public void menuListLoadGame()
    {        Display.getDisplay(this).setCurrent(myCanvas);
        myCanvas.loadGame();
        myCanvas.start();       
    
    }
    public void menuListInstructions()     {

/>         Display.getDisplay(this).setCurrent(new InstructionsScreen(this));     }     public void menuListOptions()     {         Display.getDisplay(this).setCurrent(new OptionsScreen(this));     }         public void splashScreenDone()     {         menuList = new MenuList(this);         myCanvas = new SuDoKuCanvas(this);
        Display.getDisplay(this).setCurrent(menuList);     }     public void instructionsBack()     {         Display.getDisplay(this).setCurrent(menuList);
    }     public void gameBack()     {         menuList.setGameActive(true);         Display.getDisplay(this).setCurrent(menuList);     }     public void menuListContinue()     {         Display.getDisplay(this).setCurrent(myCanvas);         myCanvas.start();     }     public void optionsBack(byte level,byte back,byte input,byte music)<>     {        myCanvas.setOptions(level,back,input,music);         Display.getDisplay(this).setCurrent(menuList);              }     public void pauseApp()     {     }<>     public void destroyApp(boolean unconditional)     {     }     public void notifyGameOver(byte level,long  gameDuration,boolean isSolved)     {          String strTime;         String s;<>         long temp;         temp = gameDuration / 1000;         strTime = (gameDuration % 60) + " 秒" ;         if (temp >= 60){         temp = temp / 60;<>         strTime = (temp % 60) + " 分  "  + strTime;         if (temp >=60){         temp = temp/ 60;         strTime = temp + " 小时  "+ strTime;
      }       }       if(isSolved)s="恭喜,在"+strTime+"内您顺利完成了本题!";       else s="未能完成本题,请继续加油!";       if (alert == null)         {            alert = new Alert ("游戏结束");            alert.setTimeout (Alert.FOREVER);            alert.setType (AlertType.INFO);
        }         alert.setString (s);         Image imgGameOver;         if(isSolved)imgGameOver = createImage("/win.png");         else imgGameOver = createImage("/lose.png");         alert.setImage(imgGameOver);
/>         menuList.setGameActive(false);         Display.getDisplay(this).setCurrent (alert, menuList);
    }
              public void quit()     {         destroyApp(false);
        notifyDestroyed();     }     // method needed by lots of classes, shared by putting it here
    static Image createImage(String filename)     {         Image image = null;
        try         {             image = Image.createImage(filename);         }         catch (java.io.IOException ex)
        {             // just let return value be null         }         return image;     } }
解决方案2:

底层api 和高层api都可以的

解决方案3:

同意。。。。关键是好看的画面。

引用 2 楼 vellee 的回复:
如果想用j2me来写的话可以学学lwuit,你说的这个很容易实现。
解决方案4:

看到了就回复一下。
具体程序案例见我的博客:
j2me小程序"爱情波折指数.jar"程序源码<> http://blog.csdn.net/qq379264347/article/details/6805520

解决方案5:

来了就支持下!

解决方案6:

如果想用j2me来写的话可以学学lwuit,你说的这个很容易实现。

解决方案7:

帮顶下。


以上介绍了“ j2me小应用程序 有兴趣的进”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/1951034.html

相关图片

相关文章