• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ticker on mobile

 
Purwa Jain
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to implement a ticker on the mobile. But I am clueless of where do I start from. Can anyone help me please.

Regards.
 
Shoumin Li
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's easy.This is a sample:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.lcdui.Ticker;

public class TickerDemo extends MIDlet implements CommandListener
{
private Display display;
private Command exit;
Form frm;
private Ticker ticker;

public TickerDemo()
{
//Create a ticker with message
ticker =new Ticker("Hello from Ticker");
display = Display.getDisplay(this);

}
public void startApp()
{
frm=new Form("Ticker Demo");
exit= new Command("Exit",Command.EXIT,1);
frm.addCommand(exit);
frm.setCommandListener(this);
//add ticker to displayable
frm.setTicker(ticker);

frm.append("#####");
display.setCurrent(frm);
}
public void pauseApp()
{

}
public void destroyApp(boolean un)
{
}
public void commandAction(Command cmd,Displayable d)
{

if(cmd==exit)
{


}
}

}
[ July 26, 2007: Message edited by: Shoumin Li ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic