<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                JxBrowser API提供允許在當前加載的網頁上的功能: * 查找指定的文本 * 高亮顯示所有匹配 * 選擇第一個匹配的文本 要在加載的網頁上查找指定的文本,請使用Browser.findText()方法。此方法返回SearchResult實例,該實例提供對搜索結果的訪問,例如匹配數和所選匹配的索引。 **注意**: *瀏覽器僅通過加載文檔上的可見內容執行搜索。如果由于CSS規則而無法在網頁上顯示某些文本,則瀏覽器在搜索期間不會瀏覽此內容。此外,瀏覽器不會搜索大小為0x0的文檔上的文本,因此請確保瀏覽器組件可見且其大小不為空。* 要清除網頁上的突出顯示(搜索結果)并取消搜索,請使用 Browser.stopFindingText(StopFindAction操作) 方法。 ``` import com.teamdev.jxbrowser.chromium.Browser; import com.teamdev.jxbrowser.chromium.SearchParams; import com.teamdev.jxbrowser.chromium.SearchResult; import com.teamdev.jxbrowser.chromium.events.FinishLoadingEvent; import com.teamdev.jxbrowser.chromium.events.LoadAdapter; import com.teamdev.jxbrowser.chromium.swing.BrowserView; import javax.swing.*; import java.awt.*; /** * This sample demonstrates, how to find text on the loaded web page. */ public class FindTextSample { public static void main(String[] args) { final Browser browser = new Browser(); BrowserView browserView = new BrowserView(browser); JFrame frame = new JFrame(); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.add(browserView, BorderLayout.CENTER); frame.setSize(700, 500); frame.setLocationRelativeTo(null); frame.setVisible(true); browser.addLoadListener(new LoadAdapter() { @Override public void onFinishLoadingFrame(FinishLoadingEvent event) { if (event.isMainFrame()) { SearchParams request = new SearchParams("find me"); // Find text from the beginning of the loaded web page. SearchResult result = browser.findText(request); System.out.println(result.indexOfSelectedMatch() + "/" + result.getNumberOfMatches()); // Find the same text again from the currently selected match. result = browser.findText(request); System.out.println(result.indexOfSelectedMatch() + "/" + result.getNumberOfMatches()); } } }); browser.loadHTML("<html><body><p>Find me</p><p>Find me</p></body></html>"); } } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看