Beispiel #1
0
 public static void main(String[] args) throws IOException {
   String url = "http://www.ustc.edu.cn/";
   if (args.length != 0 && args[0].length() != 0) {
     url = args[0];
   }
   Document dom;
   try {
     URL uurl = new URL(url);
     HTMLWrapper hw = new HTMLWrapper(url);
     dom = hw.getDOM();
   } catch (IOException e) {
     dom = HTML2DOM.getDOM(new FileInputStream(url));
   }
   view(dom);
 }
Beispiel #2
0
 void reloadJTree(String url) {
   System.out.println("reload " + url);
   Document dom;
   try {
     URL uurl = new URL(url);
     HTMLWrapper hw = new HTMLWrapper(url);
     dom = hw.getDOM();
   } catch (IOException e) {
     e.printStackTrace();
     try {
       dom = HTML2DOM.getDOM(new FileInputStream(url));
     } catch (IOException ie) {
       JOptionPane.showMessageDialog(this, "can't get document of the url: " + url);
       ie.printStackTrace();
       return;
     }
   }
   document = dom;
   jtree.setRootNode(dom);
 }