Problem with '/n'
hello all,
was writing a code given below
strtext=textField.getText();
for(i=0;i<strtext.length();i++)
{
code=strtext.charAt(i);
if(!(((code>=2309)&&(code<=2399)) ||(code == 32) ||(code =='\n')) )
{
new MessageDialog(window,"error messg");
return;
}
}
let me explain the code a bit:
textfield is a Text Field widget and textfeild.getText() will return the text entered and is saved in a string strtext. All the variables are initialized appropriately. Also MessageDialog is another widget container which will be displayed if the conditions are met.The code works fine if I exclude one condition,i.e.,code == '\n' (escape sequence for line feed). I just included this condition.
Now whenever I include a line feed in the textfield(or strtext for that matter) the following error cames up
(java.lang.ArrayIndexOutOfBoundsException
at java.lang.reflect.Array.get(Native Method)
Most of this code uses the Buoy widget library(an open source library built on top of Swing) and is written in Beanshell Script( another Java OS scripting language), so it could also be an error related to the scripting language(though I don't think it is, but you can never be sure)
Help needed plz....

