How to search within JBCefBrowser

Answered

Hi

I am creating a plugin to manager web tab, I want to search within web, like chrome shortcut: ctrl+f 

what should I do

Thanks

0
4 comments

Hi,

You can create a Swing component that will be shown when a user invokes finding action. A component should contain a text field for a search phrase. When a user types some text, you should invoke the find() method on org.cef.browser.CefBrowser rendering your content, which can be retrieved from JBCefBrowser.getCefBrowser(), e.g.:

myPanel.jbCefBrowser.cefBrowser.find(0, searchText, forward, matchCase, findNext)
0

Thanks for your reply,

but how can I create a shorcut for a panel within toolwindow, the shorcut  is only available when the toolwindow is active

0

Great!

I have read this post before, and I read it again, I found JComponent.registerKeyboardAction()  is suitable.

Inspired by you, I found many methods in CefBrowser is exactly what I want

Thak you very much

0

Please sign in to leave a comment.