void submit(JComponent source) {
public void submit(JComponent source) {
    void submit(JComponent source) {        StringBuffer data = new StringBuffer();        Iterator fields = components.entrySet().iterator();        while (fields.hasNext()) {            Map.Entry field = (Map.Entry) fields.next();            Element e = (Element) field.getKey();            JComponent cc = (JComponent) field.getValue();            if (e.hasAttribute("disabled") &&                    e.getAttribute("disabled").equals("disabled")) {                continue;            }            if (e.getNodeName().equals("input")) {                String type = e.getAttribute("type");                if (type == null || type.equals("")) {                    type = "button";                }                if (type.equals("submit") && cc == source) {                    String value = e.getAttribute("value");                    if (value.equals("")) {                        value = "submit";                    }                    data.append('&');                    data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                    data.append("=");                    data.append(URLUTF8Encoder.encode(value));                } else if (type.equals("image")) {                    data.append('&');                    data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                    data.append("=");                    data.append(URLUTF8Encoder.encode(e.getAttribute("value")));                } else if (type.equals("checkbox")) {                    JCheckBox checkbox = (JCheckBox) cc;                    if (!checkbox.isSelected()) {                        continue;                    }                    data.append('&');                    data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                    data.append("=");                    data.append(URLUTF8Encoder.encode(e.getAttribute("value")));                } else if (type.equals("password")) {                    JPasswordField pw = new JPasswordField();                    data.append('&');                    data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                    data.append("=");                    data.append(URLUTF8Encoder.encode(pw.getPassword()));                } else if (type.equals("radio")) {                    JRadioButton radio = (JRadioButton) cc;                    if (!radio.isSelected()) {                        continue;                    }                    data.append('&');                    data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                    data.append("=");                    data.append(URLUTF8Encoder.encode(e.getAttribute("value")));                } else if (type.equals("text") || type.equals("hidden")) {                    JTextField text = (JTextField) cc;                    data.append('&');                    data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                    data.append("=");                    data.append(URLUTF8Encoder.encode(text.getText()));                }            } else if (e.getNodeName().equals("textarea")) {                JTextArea ta = (JTextArea) cc;                data.append('&');                data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                data.append("=");                data.append(URLUTF8Encoder.encode(ta.getText()));//TODO:check if we have to make linefeeds into CR-LF            } else if (e.getNodeName().equals("select")) {                JComboBox select = new JComboBox();                data.append('&');                data.append(URLUTF8Encoder.encode(e.getAttribute("name")));                data.append("=");                data.append(URLUTF8Encoder.encode(select.getSelectedItem().toString()));            }        }        data.deleteCharAt(0);//remove the first &        String action = formElement.getAttribute("action");        String method = formElement.getAttribute("method");        if (method.equals("")) {            method = "get";        }        String formData = data.toString();        //TODO: make a real submission via uac        System.out.println("Submitting form");        System.out.println("action: " + action);        System.out.println("method: " + method);        System.out.println("form data: " + formData);    }