Need some help in TextListener...
Hey i hav writen the code below.
Which is suppose to set the text in (j,i)th place same as in (i,j)th....
The code below is...
Code:
for(i=0;i<noOfVar;i++)
{
for(j=0;j<noOfVar;j++)
{
tfD[i][j].addTextListener(new TextListener()
{
public void textValueChanged(TextEvent te)
{
tfD[j][i].setText(tfD[i][j].getText());
}
});
}
}
but it is showing runtime error ---array index out of bound i.e i=noOfVar & j=noOfVar...
So i tried the different code which is as follows.....
Code:
public void textValueChanged(TextEvent te)
{
for(int i=0;i<noOfVar;i++)
{
for(int j=0;j<noOfVar;j++)
if(te.getSource()==tfD[i][j])
tfD[j][i].setText(tfD[i][j].getText());
}
}
But this code takes lots of time to execute...& also the system slows down.....
Can Any one plz help me in this matter....