tags:

views:

1094

answers:

2

How to build an image-based splash screen for my j2me application?

I already have an application and I need an splash screen to attach with it.

+3  A: 

There is no default 'splash screen' method for J2ME, it involves just showing a picture for a few seconds then carrying on with the next display. If you really want you can use the time to load some other things in the background.

This is a tutorial by Sun on splash screens

Salgar
A: 

You can use something like this:

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);
    }
}

So, all you do is just create a new instance of this class and start the Thread.

Malcolm