else if (tag == HTML.Tag.TEXTAREA) { JTextArea textArea = new JTextArea((Document) model); int rows = HTML.getIntegerAttributeValue(atts, HTML.Attribute.ROWS, 1); textArea.setRows(rows); int cols = HTML.getIntegerAttributeValue(atts, HTML.Attribute.COLS, 20); textArea.setColumns(cols); maxIsPreferred = true; comp = new JScrollPane(textArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); } else if (tag == HTML.Tag.SELECT) { if (model instanceof SelectListModel) { SelectListModel slModel = (SelectListModel) model; JList list = new JList(slModel); int size = HTML.getIntegerAttributeValue(atts, HTML.Attribute.SIZE, 1); list.setVisibleRowCount(size); list.setSelectionModel(slModel.getSelectionModel()); comp = new JScrollPane(list); } else if (model instanceof SelectComboBoxModel) { SelectComboBoxModel scbModel = (SelectComboBoxModel) model; comp = new JComboBox(scbModel); } maxIsPreferred = true; }
  protected Component createComponent()  {    Component comp = null;    Element el = getElement();    Object tag = el.getAttributes().getAttribute(StyleConstants.NameAttribute);    if (tag.equals(HTML.Tag.INPUT))      {        AttributeSet atts = el.getAttributes();        String type = (String) atts.getAttribute(HTML.Attribute.TYPE);        String value = (String) atts.getAttribute(HTML.Attribute.VALUE);        if (type.equals("button"))          comp = new JButton(value);        else if (type.equals("checkbox"))          comp = new JCheckBox(value);        else if (type.equals("image"))          comp = new JButton(value); // FIXME: Find out how to fetch the image.        else if (type.equals("password"))          comp = new JPasswordField(value);        else if (type.equals("radio"))          comp = new JRadioButton(value);        else if (type.equals("reset"))          {            if (value == null || value.equals(""))              value = RESET;            comp = new JButton(value);          }        else if (type.equals("submit"))          {            if (value == null || value.equals(""))              value = SUBMIT;            comp = new JButton(value);          }        else if (type.equals("text"))          comp = new JTextField(value);              }    // FIXME: Implement the remaining components.    return comp;  }