void nextFindStr(String str,int cur,int end){ 
if(cur>end){ 
this.statubar.setText("没有找到!"); 

else{ 
int i=this.text.getText().indexOf(str); 
if(i>=0){ 
this.text.setSelectionStart(i); 
this.text.setSelectionEnd(i+str.length()); 
this.statubar.setText("已经在:"+i+" 位置找到!"); 

else{ 
nextFindStr(str,++cur,end); 
} } 

void upFindStr(String str,int cur){ 
if(cur<0){ 
this.statubar.setText("没有找到!"); 
}else{ 
int i=this.text.getText().lastIndexOf(str); 
if(i>=0){ 
this.text.setSelectionStart(i); 
this.text.setSelectionEnd(i+str.length()); 
this.statubar.setText("已经在:"+i+" 位置找到!"); 
}else{ 
upFindStr(str,--cur); 



void replaceStr(String findStr,String replaceStr,int cur,int end){ 
if(cur>end){ 
this.statubar.setText("没有找到!"); 
}else{ 
int i=this.text.getText().indexOf(findStr); 
if(i>0){ 
this.text.setSelectionStart(i); 
this.text.setSelectionEnd(i+findStr.length()); 
this.text.replaceRange(replaceStr,this.text.getSelectionStart(),this.text.getSelectionEnd()); 
}else{ 
replaceStr(findStr,replaceStr,++cur,end); 

} }