KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > joshy > html > forms > InputText


1 package org.joshy.html.forms;
2
3 import java.util.*;
4 import java.awt.Dimension JavaDoc;
5 import java.awt.Point JavaDoc;
6 import javax.swing.JTextField JavaDoc;
7 import javax.swing.JComponent JavaDoc;
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 JavaDoc createComponent(Element elem) {
19         JTextField JavaDoc comp = new JTextField JavaDoc();
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