用JEditorPane.setPage(String url) 往JEditorPane中输入内容后显示的HTML的源代码,内容格式为"text/plain", 怎样使其内容格式一直为  " text / html " 显示HTML的可视化界面,谢谢! 
(使用JEditorPane.setContentType("text / html")  不行) 

解决方案 »

  1.   

    jEditorPan初始化后设置下面的属性   
    jEditorPane.setContentType("text/html");   
    也不行吗,报什么错误?
      

  2.   

    我在sun的官网上找到这个帖子
    上面也是遇到这个问题好像是版本的bughttp://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4149008"I've been trying to do exactly this with swing 1.1.1 beta2 and find the same
    bug.  The bug report states that this bug has been fixed, but I can't tell from
    the bug report orits evaluation section whether or not this bug has been fixed
    in the release I'm trying to use"
      

  3.   

    使用jEditorPane.setContentType("text/html");  不行也不报错!
      

  4.   

    似乎没问题,还是说没有理解你的意图?
    public static void main(String[] args) throws Exception{ 
         JEditorPane pane=new JEditorPane();
         pane.setContentType("text / html");
         pane.setPage("http://www.baidu.com");
              JFrame frame=new JFrame();
         //frame.getContentPane().setLayout(new BorderLayout());
         frame.getContentPane().add(pane);
         frame.setSize(1024, 768);
         frame.setVisible(true);
        }