public void setDocument(Document doc, URL url) { this.doc = doc; Element html = (Element)doc.getDocumentElement(); c.css = new CSSBank(); c.setBaseURL(url); try {  Object marker = new DefaultCSSMarker();  InputStream stream = marker.getClass().getResourceAsStream("default.css"); c.css.parse(new InputStreamReader(stream)); c.css.parseInlineStyles(html); } catch (Exception ex) { u.p("error parsing CSS: " + ex); u.p(ex); } this.body_box = null; calcLayout(); repaint();
public void setDocument(String filename) throws Exception { setDocument(x.loadDocument(filename),new File(filename).toURL());
    public void setDocument(Document doc, URL url) {        this.doc = doc;        Element html = (Element)doc.getDocumentElement();        c.css = new CSSBank();        c.setBaseURL(url);        try {            //c.css.parse(new FileReader("second.css"));            Object marker = new DefaultCSSMarker();            //u.p("getting: " + marker.getClass().getResource("default.css"));            InputStream stream = marker.getClass().getResourceAsStream("default.css");            c.css.parse(new InputStreamReader(stream));            c.css.parseInlineStyles(html);        } catch (Exception ex) {            u.p("error parsing CSS: " + ex);            u.p(ex);        }        this.body_box = null;        calcLayout();        repaint();    }