JEdi​​torPane不尊重html表高度100%

时间:2010-01-07 13:57:03

标签: java html swing

我遇到了问题,我的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>

非常感谢

1 个答案:

答案 0 :(得分:1)

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

相关问题