JAVA类访问URL

 URI uri = new URI("https://www.baidu.com/"); 
      Desktop desktop = null; 
      if (Desktop.isDesktopSupported()) { 
       desktop = Desktop.getDesktop(); 
      } 
      if (desktop != null) 
       desktop.browse(uri); 
     } catch (IOException ioe) { 
      ioe.printStackTrace(); 
     } catch (URISyntaxException e) { 
      e.printStackTrace(); 
     } 

posted @ 2015-08-25 14:50  攻城狮不是猫  阅读(106)  评论(0编辑  收藏  举报