Class jclass.contrib.JCCheckbox
All Packages Class Hierarchy This Package Next Index
Class jclass.contrib.JCCheckbox
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Checkbox
|
+----jclass.contrib.JCCheckbox
- public class JCCheckbox
- extends Checkbox
The Checkbox class in the Java AWT does not allow a value to
be associated with the checkbox. JCCheckbox does allow this
through the value member variable.
JCCheckbox 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 JCCheckboxGroup, 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.
-
JCCheckbox(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.
JCCheckbox
public JCCheckbox(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 JCCheckboxGroup, then the checkbox is
added to the list of items in JCCheckboxGroup. See
JCCheckboxGroup 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 JCCheckboxGroup 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 JCCheckboxGroup containing the specified check
boxes.
makeCollection
public static JCCheckbox[] 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 JCCheckbox objects
All Packages Class Hierarchy This Package Next Index