the super class of all swing button is a) button b) button group c) jbutton d) abstractbutton
Answers
Answer:
C is the right answer
ANSWER:
The correct option is d. AbstractButton
EXPLANATION:
There are four different types of buttons in Swing.
They are:
- JButton
- JToggleButton
- JCheckBox and
- JRadioButton
The above-mentioned 4 buttons are subclasses of the AbstractButton class, which extends JComponent.
Let’s analyse the options given in the question:
a.button - The button is a control component that has a label and generates an event when pressed
b.buttongroup - To create a multiple-exclusion scope for a set of buttons buttongroup is used. Creating a group of buttons with the identical ButtonGroup object means that turning "on" one button turns off all other buttons within the group
c.jbutton – This belongs to Swing, which is a subclass of the AbstractButton class.
d.abstractbutton – This is the correct option. Since all 4 swing buttons are subclasses of this class.
So, the superclass of all swing buttons is AbstractButton.
The correct option is d. AbstractButton
#SPJ2