3
我應該想要在JTextPane中實現搜索功能。我已經使用了swingx,並且我看到了Searchable
接口,其中有一個JXEditorPane.DocumentSearchable
。我想這是JXEditorPane。我使用JTextPane。這有一些例子嗎?在JTextPane中搜索Swingx
謝謝。
我應該想要在JTextPane中實現搜索功能。我已經使用了swingx,並且我看到了Searchable
接口,其中有一個JXEditorPane.DocumentSearchable
。我想這是JXEditorPane。我使用JTextPane。這有一些例子嗎?在JTextPane中搜索Swingx
謝謝。
如果你想重用SwingX提供的搜索組件(例如JXFindBar
)爲您JTextPane
就足以創造Searchable
界面,工作對你JTextPane
的實現。然後可以將此Searchable
實例傳遞給JXFindBar
。
JXEditorPane.DocumentSearchable
或多或少是你想要的,因爲它對Document
(見source code)起作用,所以從這個源代碼開始,你應該在jiffy中準備好自己的實現。