請各位幫幫忙...
findWord = JOptionPane.showInputDialog("Find:");
if (findWord == null) {
JOptionPane.showMessageDialog(null, "find error");
} else {
fingWordLength = findWord.length();
currentTextInTextArea = textPane[getTextPaneNum()].getText();
findIndex = currentTextInTextArea.indexOf(findWord);
if (findIndex < 0){
JOptionPane.showMessageDialog(null,"not find!");
}  else {
textPane[getTextPaneNum()].select(findIndex, findIndex + fingWordLength);
}
}這個可以做到用textPane搜字但當使用者換行後就會因為換行而令搜索出現問題,
請問要如何才不會因為換行而改變select出來的位置?
萬分感激~