Uncaught exception java/lang/ArrayIndexOutOfBoundsException

Hi,

this is my first application (copyed by an example).

i don't understand why i found this exception:

"Uncaught exception java/lang/ArrayIndexOutOfBoundsException"

this is the code

import javax.microedition.lcdui.Command;

import javax.microedition.lcdui.Display;

import javax.microedition.lcdui.Form;

import javax.microedition.midlet.MIDlet;

import javax.microedition.midlet.MIDletStateChangeException;

publicclass Menuextends MIDlet{

private Display display;

private Form fmMain;

private Command cmExit;

private Command cmFirst;

public Menu(){}

protectedvoid pauseApp(){}

protectedvoid destroyApp(boolean arg0)throws MIDletStateChangeException{}

protectedvoid startApp()throws MIDletStateChangeException{

display = Display.getDisplay(this);

cmExit =new Command("Exit", Command.EXIT, 1);

cmFirst =new Command("HELLO", Command.SCREEN, 2);

fmMain =new Form("First application");

fmMain.addCommand(cmExit);

fmMain.addCommand(cmFirst);

display.setCurrent(fmMain);

}

}

can someone help me?

ty

[2379 byte] By [simone83a] at [2007-10-3 3:56:51]
# 1
what is the full stack trace and which line number does it say has got the error?code you've given is not giving too much information
r035198xa at 2007-7-14 21:55:08 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...
# 2

Hello,

I have a same problem about j2me application. I have written a simple code(hello world) and it doesn't work. code is very simple

import javax.microedition.midlet.*;

import javax.microedition.lcdui.*;

public class Hello extends MIDlet

{

public Hello() {}

public void pauseApp() {}

public void destroyApp(boolean ignore) {}

public void startApp()

{

Display.getDisplay(this).setCurrent(

new TextBox("Hello", "The End", 9, 0));

}

}

and it gives a

Uncaught exception java/lang/ArrayIndexOutOfBoundsException

error

pls help me?

sed_at_2008a at 2007-7-14 21:55:08 > top of Java-index,Developer Tools,Debugging and Profiling Tool APIs...