[英]How to show the Button in the bottom of the JScrollPane Inside a JFrame
我正在開發一個應用程序,我試圖在其中顯示 JFrame 中的橫幅。在 JFrame 中,我使用了一個 JScrollbar,它使用 JEditorPane 來顯示 HTML 頁面的內容。 當前視圖看起來像這樣: 從現在開始按鈕顯示在頂部。 我想要做的是將按鈕放在屏幕底部。 我嘗試了一些布局(Box ...
[英]How to show the Button in the bottom of the JScrollPane Inside a JFrame
我正在開發一個應用程序,我試圖在其中顯示 JFrame 中的橫幅。在 JFrame 中,我使用了一個 JScrollbar,它使用 JEditorPane 來顯示 HTML 頁面的內容。 當前視圖看起來像這樣: 從現在開始按鈕顯示在頂部。 我想要做的是將按鈕放在屏幕底部。 我嘗試了一些布局(Box ...
[英]How to display HTML content and password field in a single frame?
我在JScrollPane內的JEditorPane中顯示了一個 HTML 頁面。 我需要在同一個 window 中創建一個JPasswordField來獲取用戶密碼。 我該如何實施? ...
[英]How can I add all the images from a website to a JEditorPane?
我有一個網站,並且已經設置了JEditorPane 。 我想遍歷網站上的所有圖像,並將它們添加到編輯器窗格中,如下所示: for (Image image : website.getImages()) { pane.add(image); } 顯然,這不是真正的代碼,但我想要類似的東西。 ...
[英]JEditorPane text/html Elements get HTML inside element
我正在 Java Swing 中創建一個 HTML 編輯器。它使用帶有 text/html MIME 類型的JEditorPane 。 我有以下 HTML 結構的情況:<body> <p>This is a <b>BOLD</b> word i ...
[英]Java JEditorPane inline table not working as expected
我正在使用JEditorPane在我的“游戲構建器”中進行代碼更正,這有助於為我的另一個游戲創建地圖。 (然后在內部使用HTMLEditorKit 。內聯 CSS 和<div>用於格式化) 我希望獲得像IDE一樣的視覺效果: [預期] (我的 StackOverflow 排名太低,無 ...
[英]Java Swing: Event for java.swing.text.View.modelToView() up-to-date
是否存在確保 modelToView 調用返回具有最新邊界的 Shape 的事件? 我有一個包含一些文本的 JEditorPane。 編輯器窗格旁邊是一個面板,它顯示行號。 為了在正確的 position 處繪制行號,我需要線條的邊界。 因此,我獲得了編輯器窗格的視圖並為每一行調用 modelTo ...
[英]How to automatically update small letter characters to capital letter in Java JEditorPane?
所以我想自動將所有輸入的字符轉換為大寫。 這是代碼的相關部分: 而 UIKeyListener Class 我只提供 keyReleased function 因為其他部分只是樣板代碼 這大部分都可以,但問題是:- 我不能 select 文本每次我輸入字符時,它們首先以小寫字母出現,然后變為大寫字 ...
[英]What's the limits of functionality for jTextPane or jEditorPane with text/html content type?
我正在使用一個 jTextPane 來顯示帶有 html 的文本。 我注意到文本窗格沒有顯示某些選項。 <html> <head> <style> body { margin-left: 10px; margin-right: 10px; line-heigh ...
[英]Open telephone number link
我想打開 MS Teams 以撥打 HTML 網頁上帶有<a href="tel:..... tel:包含的版本不支持。但是,我嘗試了這段代碼,它對普通的 HMTL 鏈接工作正常。 但這不適用於tel:鏈接 有任何想法嗎? ...
[英]JEditorPane with inline image from jar file
我有一個 JEditorPane,它顯示帶有圖像的 HTML 內容。 我找到了這篇文章: JEditorPane with inline image 。 在本文中提到使用協議處理程序“resource:”來獲取 class 路徑資源。 當我從 Eclipse 運行應用程序時,我嘗試了這個並讓它工作 ...
[英]How To Take A BufferedImage From JEditorPane?
我需要將 URL 加載到 JEditorPane 中,然后從 JEditorPane 中獲取 BufferedImge,下面的代碼將為我提供空白/黑色圖像: 我添加了 3 秒的延遲,但它不起作用,正確的做法是什么? ...
[英]Changing font in JEditorPane
Java 是我的第一語言,我主要使用它創建 CLI 應用程序,但在 2 年前為 C# 放棄了它,但選擇了它,因為它似乎最容易制作 GUI。我正在開發一個名為 MakeText 的簡單記事本盜版,主要區別:黑暗的主題。 我想制作一個工具欄按鈕來更改字體...(使用 IntelliJ idea UI ...
[英]How to set fixed width but dynamic height on JTextPane with HTML content type?
我有一個JEditorPane 。 我希望窗格高度與內容相對應。 我已經這樣做了,當窗格內容是文本時它可以工作: 首選大小根據文本內容已知。 寬度固定為 200,因此可以通過擺動輕松計算首選高度。 在控制台中,我可以看到 200、411(我固定首選高度的寬度)。 在對話框中,我們看到窗格大小合適 ...
[英]Change the selected item
我有一個JEditorPane ,當我按 ctr + space 時,它使JScrollPane可見,但是因為仍然選擇了編輯器窗格,有什么方法可以將所選項目設置為另一個? (選擇是當您按下JTextArea並且您可以編輯它時,因此選擇了文本區域。) 就像我想要的那樣,當我按 ctr + s ...
[英]Converting HTML to image (via autosized JEditorPane)
一種將 HTML 元素轉換為圖像(例如,PNG)的機制是通過JEditorPane “渲染”它,如下所示: 這種方法適用於簡單的 HTML 代碼,包括對 CSS 的基本支持。 有沒有辦法“自動檢測”寬度和高度,而不是在render()方法中明確指定它? 或者通過“普通的” Java將 HTM ...
[英]How to obtain the row from a mouse click on JEditorPane containg an HTML table
有沒有辦法在 JEditorPane 中定義的 HTML 表中獲取行索引? 我嘗試了 viewToModel 方法,但這不是我所期望的。 ...
[英]Text over an image inside a JEditorPane
有沒有辦法在JEditorPane添加帶有文本的圖像? 以下標記應該有效: <html> <head> <div width='150' height='150' style='position: relative;'> <img src='img_ ...
[英]Is there any way to get a Response from a Website displayed on JEditorPane?
我想從獨立應用程序進行身份驗證。 因此,我在JEditorPane上顯示我公司的實習生登錄頁面。 首先你會看到一個像普通的登錄窗口。 您輸入用戶名和密碼。 如果登錄成功,頁面將變為“登錄成功”。 我如何區分這些窗口並獲取第二個窗口的 URL? JEditorPane loginPane = new ...
[英]How to have page change upon clicking <a> tag in JEditorPane?
我在html頁面上有一個“a”元素,其中包含一個不同網站的href。 目前,當我點擊JEditorPane中顯示的頁面上的元素時,JEditorpane的網站不會更改網站。 它不會重定向到href的位置。 如何在重定向頁面顯示在JEditorPane中的同時解決這個問題? 謝謝! ...
[英]How can I fix this problem in JEditorPane
我試圖在JEditorPane的文本中添加一些HTML / CSS。 此類中還重寫了setText()方法。 當我在窗格中插入超過14 makeLineHighlight()然后在窗格文本上運行makeLineHighlight()或運行makeLineHighlight()兩次,一些行 ...