2009-06-17 160 views
1

如何为我的j2me应用程序构建基于图像的启动画面?j2me启动画面

我已经有一个应用程序,我需要一个启动画面来附加它。

回答

2

您可以使用这样的事情:

class SplashScreenSwitcher extends Thread { 

    private Display display; 
    private Displayable splashScreen; 
    private Displayable nextScreen; 

    public SplashScreenSwitcher(Display display, Displayable splashScreen, Displayable nextScreen) { 
     this.display = display; 
     this.splashScreen = splashScreen; 
     this.nextScreen = nextScreen; 
    } 

    public void run() { 
     display.setCurrent(splashScreen); 
     try { 
       Thread.sleep(2000); //Here you set needed time or make a constant 
     } catch (Exception ex) {} 
     display.setCurrent(nextScreen); 
    } 
} 

所以,你要做的仅仅是创建这个类的一个新实例,并启动线程。

3

J2ME没有默认的“启动画面”方法,它只涉及几秒钟的图片,然后继续显示下一个画面。如果你真的想要,你可以使用时间在后台加载一些其他的东西。

This is a tutorial by Sun on splash screens