2009-06-17 156 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