Olá pessoal , sou novo nessa área de Java e estou tentando estudar sozinho , mas ta um pouco complicado entender os erros.
Estou começando como todo mundo pelo famoso “Hello Word”, mas n estou conseguindo fazê-lo rodar no WTK. O código, peguei num tutorial , se eu n me engano foi aki que li, la vai o código e o erro:
CÓDIGO:
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class HelloWorld extends MIDlet implements CommandListener
{
private Command exitCommand;
private TextBox tbox;
public HelloWorld() {
exitCommand = new Command("Exit", Command.EXIT, 1);
tbox = new TextBox("Hello World MIDlet", "Hello World!", 25, 0);
tbox.addCommand(exitCommand);
tbox.setCommandListener(this);
}
protected void startApp()
{
Display.getDisplay(this).setCurrent(tbox);
}
protected void pauseApp()
{
}
protected void destroyApp(boolean bool) {
}
public void commandAction(Command cmd, Displayable disp)
{
if (cmd == exitCommand)
{
destroyApp(false);
notifyDestroyed();
}
}
}
ERRO:
java.lang.InstantiationException: Class not a MIDlet
at com.sun.midp.midlet.MIDletState.createMIDlet(+51)
at com.sun.midp.midlet.Selector.run(+22)
Se alguém puder me ajudar ficarei muito grato!!
