![](/img/trans.png)
[英]import error while adding TextEditor to eclipse plugin - Cannot find the class file for org.eclipse.jface.text.revisions.RevisionInformation
[英]Find Next in texteditor
我正在尝试在JTextArea
编写搜索功能。 我这样做是为了寻找,但是寻找下一个是我被困住的地方。 在JTextArea
中找到所有单词之前,不应关闭JOptionPane
。
private void findActionPerformed(java.awt.event.ActionEvent evt) {
findString = JOptionPane.showInputDialog(null, "Find What", "Find", JOptionPane.INFORMATION_MESSAGE);
text = editorTextArea.getText();
index = text.indexOf(findString, 0);
editorTextArea.setCaretPosition(index);
editorTextArea.setSelectionStart(index);
editorTextArea.setSelectionEnd(index + findString.length());
}
使用最后一个查找完成后,请使用非模态JDialog并手动对其进行处理。 有关JDialog的更多详细信息,请访问http://docs.oracle.com/javase/tutorial/uiswing/components/dialog.html。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.