•Jbutton
•Buttons That Maintain State
•JCheckBox
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
JButton
A button is a component the user clicks to trigger a
specific action.
Types of buttons includes, command buttons,
checkboxes, toggle buttons and radio buttons.
All the button types are subclasses of AbstractButton
(package javax.swing).
A command button generates an ActionEvent when
the user clicks it.
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
JButton
Command buttons are created with class JButton.
The text on the face of a JButton is called a button
label.
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
Jbutton- Example
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
Jbutton- Example
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
Jbutton- Example
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
Buttons That Maintain State
Three types of state buttons - JToggleButton,
JCheckBox and JRadioButton.
That have on/off or true/false values.
Many JRadioButtons are grouped together and are
mutually exclusive - only one in the group can be
selected at any time.
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
JCheckBox- Example
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
JCheckBox- Example
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
JCheckBox- Example
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer
Thank You
Prepared by: Anil Kumar Tailor, Assistant Prof.
Engineering College Ajmer