Friday, December 25, 2009

Ticker in Java ME

A Ticker is simply a scrolling text across the device screen.



The method setTicker(Ticker) can be used with Displayable, to set Ticker replacing any previous ticker.

- Start Java ME SDK 3.0,

- Create a new project of MIDP Application in Java ME SDK Category (it's the only category currently), with name of HelloTicker. Accept the default Project Location and Project Folder, and also select to Set as Main Project and Create Hello MIDlet. Accept the Default Platform Selection

- Insert the code below inside the method startApp(), as shown in the picture.

Ticker ticker = new Ticker("...this is Ticker!");
Displayable displayable = Display.getDisplay(this).getCurrent();
displayable.setTicker(ticker);