JButton jb = null;
JLabel lbl = null;
    public ReplacedElement createReplacedElement(            LayoutContext c, BlockBox box,            UserAgentCallback uac, int cssWidth, int cssHeight) {        Element e = box.element;        JComponent cc = null;        if (e == null) {            return null;        }        if (e.getNodeName().equals("img")) {            cc = getImageComponent(e);            if (cc == null) {                JButton jb = null;                Image im = null;                FSImage fsImage = uac.getImageResource(e.getAttribute("src")).getImage();                if (fsImage != null) {                    im = ((AWTFSImage) fsImage).getImage();                }                if (im == null) {                    jb = new JButton("Image unreachable. " + e.getAttribute("alt"));                } else {                    Image i2 = im.getScaledInstance(cssWidth, cssHeight, Image.SCALE_FAST);                    ImageIcon ii = new ImageIcon(i2, e.getAttribute("alt"));                    jb = new JButton(ii);                }                jb.setBorder(BorderFactory.createEmptyBorder());                jb.setSize(jb.getPreferredSize());                jb.setContentAreaFilled(false);                addImageComponent(e, jb);                cc = jb;            }        } else {            //form components            Element parentForm = getParentForm(e);            //parentForm may be null! No problem! Assume action is this document and method is get.            XhtmlForm form = getForm(parentForm);            if (form == null) {                form = new XhtmlForm(uac, parentForm);                addForm(parentForm, form);            }            cc = form.addComponent(e);        }        if (cc == null) {            return null;        } else {            SwingReplacedElement result = new SwingReplacedElement(cc);            if (c.isInteractive()) {                c.getCanvas().add(cc);            }            return result;        }    }