【问题标题】:JEditorPane do not respect html table height 100%JEdi​​torPane 不尊重 html 表格高度 100%
【发布时间】:2010-01-07 22:30:19
【问题描述】:

我有一个问题,我的 JEditorPane 不尊重 HTML-Table style="height: 100%;" 你有什么想法吗?

JEditorPane jEditorPane = new JEditorPane();
JScrollPane scrollPane = new JScrollPane( jEditorPane );
jEditorPane.setPage( url );
JFrame frame = new JFrame( );
frame.getContentPane( ).add( scrollPane, BorderLayout.CENTER );
frame.setSize( 800, 600 );
frame.setVisible( true );


<html style="height: 100%;">
  <body style="height: 100%;">
  </head><body>
    <table style="height: 100%;width: 100%"  border="1">
       <tr><td>1</td><td>12</td></tr>
       <tr><td>2</td><td>22</td></tr>
    </table>
  </body>
</html>

非常感谢

【问题讨论】:

    标签: java html swing


    【解决方案1】:

    JEditorPane 的 HTML 支持适用于 version 3.2。 HTML 3.2 tables 没有 style 属性。

    【讨论】:

    • 也许可以看看 Flying Saucer 项目的 Swing XHTML 渲染器
    猜你喜欢
    • 2011-06-06
    • 2012-07-29
    • 2011-08-20
    • 1970-01-01
    • 2013-10-06
    • 2013-01-29
    • 2014-09-15
    • 1970-01-01
    • 2012-03-14
    相关资源
    最近更新 更多