下面的代码是用Dreamweaver编辑出来的很简单的一个页面。
将JEditorPane的文档类型设置为text/html后,将此页面setPage上去。
结果显示得好难看,CSS都没有被支持。
怎么办啊?怎么才能更好地显示网页呢?<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
font-size: 10pt;
color: #00CC00;
}
body {
background-color: #000000;
}
-->
</style></head><body>
<form id="form1" name="form1" method="post" action="">
  <table width="300" border="1" align="center" bordercolor="#003333">
    <tr>
      <td colspan="2"><div align="left"><strong>请登录</strong></div></td>
    </tr>
    <tr>
      <td><div align="right">姓名:</div></td>
      <td><input id="username" type="text" name="textfield" /></td>
    </tr>
    <tr>
      <td><div align="right">密码:</div></td>
      <td><div align="left">
        <input id="password" type="password" name="textfield2" />
      </div></td>
    </tr>
  </table>
</form>
</body>
</html>

解决方案 »

  1.   

    扩展JEditorPane这个类,但比较难啊
      

  2.   

    哦~应该是不简单……
    用Java写一个浏览器真是那么难吗?^_^
    我试用了一下HotJava浏览器3.0,发现它对页面的显示都有点糟糕
    哎~更不用说我们来写了
      

  3.   

    用swt的browser控件,不过它也是用的IE的核====CSDN 小助手 V2.5 2005年11月05日发布====
    CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
    界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/11/05/523395.aspx
    下载:http://szlawbook.com/csdnv2
      

  4.   

    对哦~^_^swt的browser控件……^_^
    好像Eclipse里面那个浏览器用的就是它……^_^