I hope that i put this question in correct section.
Today I plan to start my first lesson in j2me, and I download a simple book and I try my first program.
When I take a second step to add commands, I face an error message which is:
Expand|Select|Wrap|Line Numbers
- uncaught exception java/lang/noclassdeffounderror: readfile.
Please find my code below.
Expand|Select|Wrap|Line Numbers
- import javax.microedition.midlet.*;
- import javax.microedition.lcdui.*;
- public class ReadFile extends MIDlet implements CommandListener
- {
- private Form form1;
- private Command Ok, Quit;
- private Display display;
- private TextField text1;
- public void startApp()
- {
- form1 = new Form( "TA_Pog" );
- Ok = new Command("Ok", Command.OK, 1);
- Quit = new Command("Quit", Command.EXIT, 2);
- form1.setCommandListener(this);
- form1.addCommand(Ok);
- form1.addCommand(Quit);
- text1 = new TextField("Put Your Name :","His Name : " , 32, TextField.URL );
- form1.append(text1);
- display = Display.getDisplay(this);
- display.setCurrent(form1);
- }
- public void commandAction(Command c , Displayable d)
- {
- if (c == Ok)
- {
- Alert a = new Alert("Alert","This Alert from Ok Button", null, AlertType.ALARM);
- a.setTimeout (3000);
- display.setCurrent(a,this.form1);
- }
- else
- {
- this.notifyDestroyed();
- }
- }
- public void pauseApp() {}
- public void destroyApp( boolean bool ) {}
- }
Thanks in advance
Besr regards