System.out.println("pulling from here: " + e.getAttribute("src"));
    JComponent addComponent(Context c, Element e) {        JComponent cc = (JComponent) components.get(e);        if (cc != null) {            return cc;        }        if (e.getNodeName().equals("input")) {            String type = e.getAttribute("type");            if (type == null || type.equals("")) {                type = "button";            }            String label = e.getAttribute("value");            if (label == null || label.equals("")) {                if (type.equals("reset")) {                    label = "Reset";//TODO: this text should be from properties                }                if (type.equals("submit")) {                    label = "Submit";                }            }            if (type.equals("button") || type.equals("reset") || type.equals("submit")) {                JButton button = new JButton();                button.setText(label);                cc = button;            } else if (type.equals("image")) {                JButton jb = new JButton();                Image im = null;                if (e.hasAttribute("src")) {                    im = c.getCtx().getUac().getImage(e.getAttribute("src"));                }                if (im == null) {                    jb = new JButton("Image unreachable. " + e.getAttribute("alt"));                } else {                    ImageIcon ii = new ImageIcon(im, e.getAttribute("alt"));                    jb = new JButton(ii);                }                jb.setBorder(BorderFactory.createEmptyBorder());                cc = jb;            } else if (type.equals("checkbox")) {                JCheckBox checkbox = new JCheckBox();                checkbox.setText("");                checkbox.setOpaque(false);                if (e.hasAttribute("checked") &&                        e.getAttribute("checked").equals("checked")) {                    checkbox.setSelected(true);                }                cc = checkbox;            } else if (type.equals("password")) {                JPasswordField pw = new JPasswordField();                if (e.hasAttribute("size")) {                    pw.setColumns(Integer.parseInt(e.getAttribute("size")));                } else {                    pw.setColumns(15);                }                if (e.hasAttribute("maxlength")) {                    final int maxlength = Integer.parseInt(e.getAttribute("maxlength"));                    pw.setDocument(new PlainDocument() {                        public void insertString(int offset, String str, AttributeSet attr)                                throws BadLocationException {                            if (str == null) {                                return;                            }                            if ((getLength() + str.length()) <= maxlength) {                                super.insertString(offset, str, attr);                            }                        }                    });                }                cc = pw;            } else if (type.equals("radio")) {                JRadioButton radio = new JRadioButton();                radio.setText("");                radio.setOpaque(false);                if (e.hasAttribute("checked") &&                        e.getAttribute("checked").equals("checked")) {                    radio.setSelected(true);                }                cc = radio;            } else if (type.equals("text")) {                JTextField text = new JTextField();                if (e.hasAttribute("value")) {                    text.setText(e.getAttribute("value"));                }                if (e.hasAttribute("size")) {                    text.setColumns(Integer.parseInt(e.getAttribute("size")));                } else {                    text.setColumns(15);                }                if (e.hasAttribute("maxlength")) {                    final int maxlength = Integer.parseInt(e.getAttribute("maxlength"));                    text.setDocument(new PlainDocument() {                        public void insertString(int offset, String str, AttributeSet attr)                                throws BadLocationException {                            if (str == null) {                                return;                            }                            if ((getLength() + str.length()) <= maxlength) {                                super.insertString(offset, str, attr);                            }                        }                    });                }                if (e.hasAttribute("readonly") &&                        e.getAttribute("readonly").equals("readonly")) {                    text.setEditable(false);                }                cc = text;            } else if (type.equals("text")) {                JTextField text = new JTextField();                if (e.hasAttribute("value")) {                    text.setText(e.getAttribute("value"));                }                cc = null;//don't return it                components.put(e, text);            } else if (type.equals("hidden")) {                // TODO: hidden form fields.            } else {                XRLog.layout("unknown input type " + type);            }            if (type.equals("submit") || type.equals("image")) {                ((JButton) cc).addActionListener(new ActionListener() {                    public void actionPerformed(ActionEvent evt) {                        submit((JComponent) evt.getSource());                    }                });            }        } else if (e.getNodeName().equals("textarea")) {            int rows = 4;            int cols = 10;            if (e.hasAttribute("rows")) {                rows = Integer.parseInt(e.getAttribute("rows"));            }            if (e.hasAttribute("cols")) {                cols = Integer.parseInt(e.getAttribute("cols"));            }            JTextArea ta = new JTextArea(rows, cols);            JScrollPane sp = new JScrollPane(ta);            sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);            sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);            if (e.getFirstChild() != null) {                //Uu.p("setting text to: " + elem.getFirstChild().getNodeValue());                ta.setText(e.getFirstChild().getNodeValue());            }            cc = sp;        } else if (e.getNodeName().equals("select")) {            JComboBox select = new JComboBox();            select.setEditable(false);//cannot edit it in HTML            NodeList options = e.getElementsByTagName("option");            int selected = -1;            for (int i = 0; i < options.getLength(); i++) {                Element value = (Element) options.item(i);                String svalue = value.getFirstChild().getNodeValue();                select.addItem(svalue);                if (value.hasAttribute("selected") && value.getAttribute("selected").equals("selected")) {                    selected = i;                }            }            if (selected != -1) {                select.setSelectedIndex(selected);            }            cc = select;        }        if (cc != null) {//was a form object            cc.setSize(cc.getPreferredSize());            if (e.hasAttribute("disabled") &&                    e.getAttribute("disabled").equals("disabled")) {                cc.setEnabled(false);            }            components.put(e, cc);        }        return cc;    }