1 package org.joshy.html.forms; 2 3 import java.util.*; 4 import java.awt.Dimension ; 5 import java.awt.Point ; 6 import javax.swing.JTextField ; 7 import javax.swing.JComponent ; 8 import org.joshy.u; 9 import org.joshy.html.box.*; 10 import org.joshy.html.*; 11 import org.w3c.dom.*; 12 13 public class InputText extends FormItemLayout { 14 15 public InputText() { 16 } 17 18 public JComponent createComponent(Element elem) { 19 JTextField comp = new JTextField (); 20 if(elem.hasAttribute("value")) { 21 comp.setText(elem.getAttribute("value")); 22 } 23 if(elem.hasAttribute("size")) { 24 comp.setColumns(Integer.parseInt(elem.getAttribute("size"))); 25 } else { 26 comp.setColumns(15); 27 } 28 return comp; 29 } 30 31 } 32 | Popular Tags |