请教高手有关textpane内容查找问题
我遇到一个在textPane内查找指定字段的问题,当我自己输入一串字符时,查找没有问题,但是当使用setPage将以个html页面载入时,查找无法显示,点击查找没有反应,请各位高手解决,小弟感激不尽!
我的查找函数如下:
String st=JOptionPane.showInputDialog(null,"please insert words to find");
int index=a.getText().indexOf(st);
if(index!=-1){
a.select(index,index+st.length());
a.setSelectedTextColor(Color.red);}