Uncaught Exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hdbbdh
    New Member
    • Dec 2008
    • 24

    #1

    Uncaught Exception

    Dear All,

    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:
    Code:
    uncaught exception java/lang/noclassdeffounderror: readfile.
    So, would you please help me to understand this message? and how to solve it?
    Please find my code below.
    Code:
    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 ) {}
    }
    Note: the code above is taken exactly from a book.

    Thanks in advance
    Besr regards
Working...