Hi,

i am created program for video file play on mobile phone. i am using java wireless toolkit2.2.

my following code like

public class mathi extends MIDlet implements CommandListener{
private Display display;
private Form fmMain; // Main form
private Command cmExit; // Command to exit the MIDlet
private Command cmPlay;
private Ticker title;
public void startApp() {
display = Display.getDisplay(this);
fmMain = new Form("Zee Player");
title = new Ticker("Zaxis");
fmMain.setTicker(title);
fmMain.addCommand(cmExit);
fmMain.addCommand(cmPlay);
fmMain.setCommandListener(this);
display.setCurrent(fmMain);
}

public void pauseApp() {
}

public void destroyApp(boolean unconditional) {
}
public void commandAction(Command c, Displayable d){
if(c == cmExit)
{
destroyApp(false);
notifyDestroyed();
}
if(c == cmPlay)
{
try {
Player player = Manager.createPlayer("/Chennai1.mpg");
player.realize();
VideoControl videoControl = (VideoControl) player.getControl("VideoControl");
Item videoItem = (Item)videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE,null);
player.start();
int width = videoControl.getDisplayWidth() / 2;
int height = videoControl.getDisplayHeight() / 2;
videoControl.setDisplaySize(width, height);
}
catch(java.io.IOException ioe) {
}
catch(MediaException me) {
}
}
}
}


But , output error like

startApp threw an Exception
java.lang.NullPointerException
java.lang.NullPointerException
at javax.microedition.lcdui.Displayable.addCommand(+11)
at hello.mathi.startApp(+56)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+116)



pls help me,

regards,
M.Mathi