Explain what would happen if the radio buttons used in the QuoteOptions program were not organized into a ButtonGroup object. Modify the program to test your answer.
What will be an ideal response?
The three radio buttons used in the QuoteOptions program represent mutually exclusive choices (Comedy, Philosophy, or Carpentry). Their organization into a ButtonGroup prevents more than one of them from being selected at any point in time. The references comedy, philosophy, and carpentry are associated with JRadioButton objects, with comedy being set initially to true. These JRadioButton objects are added to a JPanel which is the primary panel containing the GUI. If they are not organized into a ButtonGroup multiple buttons can be selected at one time. However, the quote displayed is the quote associated with the last selected button (even though other buttons also may be selected).
You might also like to view...
What is a popular label producing company?
A) Okidata B) Easy Labels C) MakeIt Labels D) Avery
Text that displays in long quotation format will display:
A) with both left and right margin indents. B) centered between margins. C) left aligned. D) with justified alignment.