1/23
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
JCheckBox
The _______ class is used to create a checkbox. It is used to turn an option on (true) or off (false). Clicking on a CheckBox changes its state from "on" to "off" or from "off" to "on ".It inherits JToggleButton class.
public class JCheckBox extends JToggleButton implements AccessibleJCheckBox class declaration
JJCheckBox()
JChechBox(String s)
JCheckBox(String text, boolean selected)
JCheckBox(Action a)
Commonly used Constructors in JCheckBox:
JJCheckBox()
Creates an initially unselected check box button with no text, no icon.
JChechBox(String s)
Creates an initially unselected check box with text.
JCheckBox(String text, boolean selected)
Creates a check box with text and specifies whether or not it is initially selected.
JCheckBox(Action a)
Creates a check box where properties are taken from the Action supplied.
AccessibleContext getAccessibleContext()
protected String paramString()
Commonly used Methods in JCheckBox:
AccessibleContext getAccessibleContext()
It is used to get the AccessibleContext associated with this JCheckBox.
protected String paramString()
It returns a string representation of this JCheckBox.
JRadioButton
The _______ class is used to create a radio button. It is used to choose one option from multiple options. It is widely used in exam systems or quiz. It should be added in ButtonGroup to select one radio button only.
public class JRadioButton extends JToggleButton implements AccessibleJRadioButton class declaration
JRadioButton()
JRadioButton(String s)
JRadioButton(String s, boolean selected)
Commonly used Constructors in JRadioButton:
JRadioButton()
Creates an unselected radio button with no text.
JRadioButton(String s)
Creates an unselected radio button with specified text.
JRadioButton(String s, boolean selected)
Creates a radio button with the specified text and selected status.
void setText(String s)
String getText()
void setEnabled(boolean b)
void setIcon(Icon b)
Icon getIcon()
void setMnemonic(int a)
void addActionListener(ActionListener a)
Commonly used Methods in JRadioButton:
void setText(String s)
It is used to set specified text on button.
String getText()
It is used to return the text of the button.
void setEnabled(boolean b)
It is used to enable or disable the button.
void setIcon(Icon b)
It is used to set the specified Icon on the button.
Icon getIcon()
It is used to get the Icon of the button.
void setMnemonic(int a)
It is used to set the mnemonic on the button.
void addActionListener(ActionListener a)
It is used to add the action listener to this object.