RenderQueue.getInstance().dispatchLayoutEvent(new ReflowEvent(ReflowEvent.DOCUMENT_SET));  repaint();
if (queue != null) { queue.dispatchLayoutEvent(new ReflowEvent(ReflowEvent.DOCUMENT_SET)); }
    public void setDocument(Document doc, String url, NamespaceHandler nsh) {        resetScrollPosition();        this.doc = doc;        //have to do this first        getRenderingContext().setBaseURL(url);        getContext().setNamespaceHandler(nsh);        getRenderingContext().getStyleReference().setDocumentContext(getContext(), getContext().getNamespaceHandler(), doc, this);        RenderQueue.getInstance().dispatchLayoutEvent(new ReflowEvent(ReflowEvent.DOCUMENT_SET));        //calcLayout();        repaint();    }