All Packages Class Hierarchy This Package Previous Next Index
Class net.strandberg.html.Checkbox
java.lang.Object
|
+----net.strandberg.html.Checkbox
- public class Checkbox
- extends Object
- implements HTMLItem
The class Checkbox is used to create HTML checkboxes to be
used in Forms. To create a checkbox, inside an HTML form, that looks
like this:
you would need HTML code like this:
<INPUT TYPE="checkbox" NAME="asHTML" VALUE="Yes">Generate as HTML
which is created by this Java code:
Checkbox cb = new Checkbox("asHTML", "Generate as HTML", "Yes", false);
String myString = cb.toHTML();
- Version:
- $Revision: 0.0 $
- Author:
- Mats Strandberg
- See Also:
- Form
-
Checkbox(String, String)
- Constructs a checkbox with a label.
-
Checkbox(String, String, String)
- Constructs a checkbox with a label.
-
Checkbox(String, String, String, boolean)
- Constructs a checkbox with a label.
-
main(String[])
- Tests the class
-
putLabelLeftOfBox()
- Aligns the label to the left of the checkbox.
-
toHTML()
-
Checkbox
public Checkbox(String name,
String label,
String value)
- Constructs a checkbox with a label. The label will by default be placed to the
right of the checkbox. The HTML code for this checkbox will be generated as a
table item, i.e. a table cell.
- Parameters:
- name - the name of this checkbox in the form
- label - the text presented next to the checkbox
- value - the value that the name of this checkbox in a form
will be assigned to when box is ticked will be "Y".
Checkbox
public Checkbox(String name,
String label,
String value,
boolean asTableItem)
- Constructs a checkbox with a label. The label will by default be placed to the
right of the checkbox. The HTML code for this checkbox will be generated as a
table item, i.e. a table cell.
- Parameters:
- name - the name of this checkbox in the form
- label - the text presented next to the checkbox
- value - the value that the name of this checkbox in a form
will be assigned to when box is ticked.
- asTableItem - if true the HTML code for this checkbox will be generated as a
table item, i.e. a table cell
Checkbox
public Checkbox(String name,
String label)
- Constructs a checkbox with a label. The label will by default be placed to the
right of the checkbox. The HTML code for this checkbox will be generated as a
table item, i.e. a table cell. The value that the name of this checkbox in a form
will be assigned to when box is ticked will be "Yes".
- Parameters:
- name - the name of this checkbox in the form
- label - the text presented next to the checkbox
putLabelLeftOfBox
public void putLabelLeftOfBox()
- Aligns the label to the left of the checkbox. (The label is by default right of
the checkbox).
toHTML
public String toHTML()
main
public static void main(String args[])
- Tests the class
All Packages Class Hierarchy This Package Previous Next Index