国产chinesehdxxxx野外,国产av无码专区亚洲av琪琪,播放男人添女人下边视频,成人国产精品一区二区免费看,chinese丰满人妻videos

App下載
首頁(yè)javajeditorpaneJava Swing - 如何對(duì)齊JEditorPane中文本中的圖像

Java Swing - 如何對(duì)齊JEditorPane中文本中的圖像

我們想知道如何對(duì)齊JEditorPane中文本中的圖像。
import java.awt.BorderLayout;

import javax.swing.JEditorPane;
import javax.swing.JFrame;
import javax.swing.JScrollPane;

public class Main extends JFrame {
  public Main() {
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setLocationByPlatform(true);

    JEditorPane editPane = new JEditorPane();
    JScrollPane scrollPane = new JScrollPane(editPane);

    editPane.setContentType("text/html");

    editPane
        .setText("<html><p style = \"text-align:center;\">Hello there, How you doing ?<img src = "
            + "\"http://eska-fuses.cn/style/download.png"
            + "\" alt = \"pic\" width = \"15\" height = \"15\" />test test test"
            + "<br />I hope this is what you wanted!! "
            + "<img src =  \"http://eska-fuses.cn/style/download.png"
            + "\" alt = \"pic\" width = \"15\" height = \"15\" /> this is a test.</p></html>\n");

    add(scrollPane, BorderLayout.CENTER);
    setSize(400, 300);
    setVisible(true);
  }

  public static void main(String... args) {
    new Main();
  }
}