我用JTextPane来显示html页面,可是总是抛出异常response code invalid下面的写法不对吗?JTextPane textPane = new JTextPane();
textPane.setContentType("text/html");
String url = "http://www.csdn.net";
try{
    textPane.setPage(url);
}catch(Exception e)
{
    System.out.println(e.toString());
}不用JTextPane和JEditPane还有没有其他控件可以显示html页面?另外有没有好的控件能够直接用html页面的内容数据作为输入(不是用url地址)来显示html??

解决方案 »

  1.   

    没接触过JTextPane,帮你顶顶吧
      

  2.   

    JTextPane textPane = new JTextPane();
    textPane.setContentType("text/html");
    String url = "http://120.221.9.77/index.html";   
    try{
        textPane.setPage(url);
    }catch(Exception e)
    {
        System.out.println(e.toString());
    }出错信息是  java.io.IOException: Response code not available可是url地址是有效的呀,直接用ie是可以打开页面的。
    是不是我发错地方了,怎么这里一点反映也没有。。急……
      

  3.   

    JTextPane 就是从JEditorPane派生出来的,两个我都是过了,都是同样的问题。很奇怪的问题,按理说应该能正常显示才对。
    算了,问题解决不了世界杯还是要看。