Page 2 :
1.3 AWT Controls and Layout Managers:, 2, , , , , Checkbox:, Checkbox control is used to turn an option on(true) or, off(false)., , , , There is label for each checkbox representing what the, checkbox does., , , , The state of a checkbox can be changed by clicking on, it.
Page 3 :
1.3 AWT Controls and Layout Managers:, 3, , , , , Checkbox:Constructors, Checkbox()-Creates a check box with an empty string, for its label., , , , Checkbox(String label)-Creates a check box with the, specified label., , , , Checkbox(String label, boolean state)-Creates a, check box with the specified label and sets the, specified state.
Page 4 :
1.3 AWT Controls and Layout Managers:, 4, , , , , Checkbox:Constructors, Checkbox(String, , label,, , boolean, , state,, , CheckboxGroup group)- Constructs a Checkbox with, , the specified label, set to the specified state, and in the, specified check box group.
Page 5 :
1.3 AWT Controls and Layout Managers:, 5, , , , , Checkbox:Constructors, Checkbox(String label, CheckboxGroup group,, boolean state)- Creates a check box with the specified, , label, in the specified check box group, and set to the, specified state.
Page 6 :
1.3 AWT Controls and Layout Managers:, 6, , , , , Checkbox: Methods, CheckboxGroup, , getCheckboxGroup()-Determines, , this check box's group., , , String getLabel()-Gets the label of this check box., , , , boolean getState()-Determines whether this check box, is in the on or offstate.
Page 7 :
1.3 AWT Controls and Layout Managers:, 7, , , , , Checkbox: Methods, void setCheckboxGroup(CheckboxGroup g)-Sets, this check box's group to the specified check box, , group., , , void setLabel(String label)-Sets this check box's label, to be the string argument., , , , void setState(boolean state)-Sets the state of this, check box to the specified state.
Page 8 :
1.3 AWT Controls and Layout Managers:, 8, , , , , Checkbox: Methods, void setCheckboxGroup(CheckboxGroup g)-Sets, this check box's group to the specified check box, , group., , , void setLabel(String label)-Sets this check box's label, to be the string argument., , , , void setState(boolean state)-Sets the state of this, check box to the specified state.
Page 9 :
1.3 AWT Controls and Layout Managers:, 9, , , , , Handling Checkbox:, Each time a check box is pressed, an item event is, generated. This is sent to any listeners that previously, , registered an, , interest, , in, , receiving, , notifications from that component., , item, , event
Page 10 :
1.3 AWT Controls and Layout Managers:, 10, , , , , Handling Checkbox:, Each Listener implements the ItemListener interface., That interface defines the itemStateChanged() method, , which is called when an event occurs. An ItemEvent, object is supplied as the argument to this method. It, contains information about the event., , , Method Signature:, , public void itemStateChanged(ItemEvent ie)
Page 11 :
1.3 AWT Controls and Layout Managers:, 11, , , , Checkbox: Example
Page 12 :
1.3 AWT Controls and Layout Managers:, 12, , , , , CheckboxGroup:, A check box group is a set of checkboxes in which one, and only one checkbox can be checked at any one, , time. Any other previously selected checkbox in the, group is unchecked. These checkboxes are sometimes, called radio buttons, because they act like the station, selector on a car radio-,only one station can be selected, at any one time .
Page 13 :
1.3 AWT Controls and Layout Managers:, 13, , , , , CheckboxGroup:, Check box groups are objects of CheckboxGroup, class. Only the default constructor is defined which, , creates an empty group.
Page 15 :
1.3 AWT Controls and Layout Managers:, 15, , , , , CheckboxGroup: Method, Checkbox getSelectedCheckbox()- Gets the current, choice from this check box group., , , , void setSelectedCheckbox(Checkbox box)-Sets the, currently selected check box in this group to be the, , specified check box.