length () error !!!

Hi

when i clicked an exit button inside ActionListener the program will automatically quits...

Ok , i add a JTextArea in main function did so...

String textenter = textarea.getText();//textarea object of JTextArea

int len = textenter.length();

i calculates the length of textarea...

and when user clicks exit button..

class ExitListenerimplements ActionListener

{

publicvoid actionPerformed(ActionEvent evtexit)

{

if(len >=1)

{

System.out.println("Success " + len);

}

}

}

But i am getting errors its not calculating length at runtime....

Would anybody help me...

[1094 byte] By [Reona] at [2007-11-27 2:25:57]
# 1
duplicate threadi answered here http://forum.java.sun.com/thread.jspa?threadID=5165556&tstart=0
calvino_inda at 2007-7-12 2:34:55 > top of Java-index,Java Essentials,Java Programming...
# 2
sorry for double posting accident happened...
Reona at 2007-7-12 2:34:55 > top of Java-index,Java Essentials,Java Programming...