Hello!
In a jtextarea, i must find the word "public"
This code works only once but i don't how to cover all the jtextarea:
int index=-1;
int finIndex;
String fin="";
index=agl.document.getText().indexOf("public");
while(index!=-1)
{
for(finIndex=index+1;fin.hashCode()!=KeyEvent.VK_ENTER;finIndex++)
{
agl.document.setSelectionStart(finIndex-1);
agl.document.setSelectionEnd(finIndex);
agl.document.select(agl.document.getSelectionStart(),agl.document.getSelectionEnd());
fin=agl.document.getSelectedText();
}
agl.document.setSelectionStart(index);
agl.document.setSelectionEnd(finIndex);
agl.document.select(agl.document.getSelectionStart(),agl.document.getSelectionEnd()-2);
index=-1;
index=agl.document.getText().indexOf(statut);
/*document is my jtextarea