【发布时间】:2023-03-07 19:03:01
【问题描述】:
我有一个默认为 450px X 400px 的 JEditorPane,我以这种方式使用 HTML 将其放入 250px X 250px 的图像中:
JEditorPane editorPanePreview = new JEditorPane();
String logosrc = MainWindow.class.getResource("/resources/logo.png").toString();
editorPanePreview.setText("<html><img src='" + logosrc + "' ></img></html>");
图像显示正确,但默认对齐在 JEditorPane 的左上角,我想将它对齐在 JEditorPane 的右下角;有可能吗?
右下角JEditorPane的内容如何对齐?
【问题讨论】:
标签: java image swing alignment jeditorpane