KickJava   Java API By Example, From Geeks To Geeks.

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


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.JButton 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 InputButton extends FormItemLayout {
14     
15     public InputButton() {
16     }
17     
18     public JComponent JavaDoc createComponent(Element elem) {
19         //u.p("created a button");
20
JButton JavaDoc comp = new JButton JavaDoc();
21         String JavaDoc label = elem.getAttribute("value");
22         comp.setText(label);
23         return comp;
24     }
25     
26     /*
27     public Box createBox(Context c, Node node) {
28         Element elem = (Element)node;
29         JButton comp = new JButton();
30         String label = elem.getAttribute("value");
31         comp.setText(label);
32         //c.canvas.remove(comp);
33         c.canvas.add(comp);
34         //comp.setSize(50,50);
35         comp.setLocation(100,100);
36         
37         //u.p("added a component to the viewport: " + comp);
38         InputBox box = new InputBox();
39         box.node = node;
40         box.component = comp;
41         return box;
42     }
43     */

44     
45     /*
46     public Dimension getIntrinsicDimensions(Context c, Element elem) {
47         //comp.setLocation(50,50);
48         return new Dimension(50,50);
49     }
50     */

51     
52     
53     
54 }
55
Popular Tags