The code:
import javax.microedition.lcdui.*;
import javax.microedition.midlet.*;
public class About extends Canvas implements CommandListener
{
private final Bartender parent;
// private Bartender midlet;
private Form fmAbout;
private Ticker tiAbout;
private Command cmdOK;
public About (Bartender parent)
{this.parent = parent; }
synchronized void start()
{
cmdOK = new Command("OK", Command.OK, 1);
//////// this part gives null pointer !!!!! /////////
fmAbout.addCommand(cmdOK);
////////////////////////////////////////////////////////
// fmAbout.setCommandListener(this);
Display.getDisplay(parent).setCurrent(fmAbout);
}
public void paint(Graphics g) {}
public void commandAction(Command c, Displayable d)
{
if (c == cmdOK)
{
Display.getDisplay(parent).setCurrent(parent.canvas2);
}}}
It's definately parent and midlet stuff (but I can't figure out how to use midlet instead of parent - I need to have it)

Reply With Quote

