如标题,我想做一个swing界面的性能测试应用程序,通过读取文件然后把文件内容当做URL的参数来访问此URl,要如何在swing界面访问此URL???

解决方案 »

  1.   

    URL url=new URL("image.gif");
    ImageIcon imageIcon=new ImageIcon(url);//根据url创建图标对象
      

  2.   

                    JEditorPane panel = new JEditorPane();
    URLClassLoader urlLoader = (URLClassLoader) getClass().getClassLoader();
    java.net.URL url = null;
    url = urlLoader.findResource("doc/ad.htm");
    panel.setPage(url1);
               把panel加到了jframe里即可     
      

  3.   

    RL url=new URL("a url"); 
    InputStream is = url.openStream();
    获得了输入流,你自己想怎么搞就怎么搞