我Utilities.getRowStart
用来找出JTextPane
. 但是BadLocationException
当我按下回车键时,它给出了:
javax.swing.text.BadLocationException:视图未表示位置
任何想法?
int offset = pane.getText().length();
while(offset > 0) {
try {
offset = Utilities.getRowStart(pane, offset) - 1;
} catch (BadLocationException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
lineCount++;
}