All Packages Class Hierarchy This Package Previous Next Index
Class jclass.contrib.ContribCheckbox
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Checkbox
|
+----jclass.contrib.ContribCheckbox
- public class ContribCheckbox
- extends Checkbox
The Checkbox class in the Java AWT does not allow a value to
be associated with the checkbox. ContribCheckbox does allow this
through the value member variable.
ContribCheckbox also contains two functions for building
groups of checkboxes:
makeGroup() takes an array of labels and an array of values and creates a group
of radio buttons with associated values for each button.
makeCollection() takes the same parameters and produces an array of individual check boxes.
In combination with ContribCheckboxGroup, these functions can simplify the creation of checkboxes.
The .class files are also reduced in size.
-
value
- This is the value associated with the checkbox.
-
ContribCheckbox(String, CheckboxGroup, int)
- This is the constructor.
-
makeCollection(Panel, String[], int[])
- This static function creates a grouping of independent
checkboxes with associated values for each of the checkboxes
-
makeGroup(Panel, String[], int[])
- This static function creates a group of radio
buttons when given an array of labels and an array of values.
value
public int value
- This is the value associated with the checkbox.
ContribCheckbox
public ContribCheckbox(String label,
CheckboxGroup group,
int val)
- This is the constructor. The first two arguments are
passed to the Checkbox construcor. If the group argument
is an instance of ContribCheckboxGroup, then the checkbox is
added to the list of items in ContribCheckboxGroup. See
ContribCheckboxGroup for details.
- Parameters:
- label - this is the text that appears beside the checkbox
- group - this is the "owner" of the box. This can be null.
- val - this is the value associated with the checkbox
makeGroup
public static ContribCheckboxGroup makeGroup(Panel parent,
String labels[],
int values[])
- This static function creates a group of radio
buttons when given an array of labels and an array of values.
- Parameters:
- panel - this is the AWT panel where the checkbox group resides
- labels[] - this is an array of labels for the checkboxes
- values[] - this is an array of values for the checkboxes
- Returns:
- a ContribCheckboxGroup containing the specified check
boxes.
makeCollection
public static ContribCheckbox[] makeCollection(Panel parent,
String labels[],
int values[])
- This static function creates a grouping of independent
checkboxes with associated values for each of the checkboxes
- Parameters:
- panel - this is the AWT panel where the checkbox group resides
- labels[] - this is an array of labels for the checkboxes
- values[] - this is an array of values for the checkboxes
- Returns:
- an array of ContribCheckbox objects
All Packages Class Hierarchy This Package Previous Next Index