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).

Computer Science & Information Technology

You might also like to view...

An expert system attempts to emulate the decision-making skills of a human expert.They are sometimes referred to as ________ intelligence because the softwareappears to have a level of intelligence derived from a computer system

Fill in the blank(s) with correct word

Computer Science & Information Technology

Identify the letter of the choice that best matches the phrase or definition.

A. Kind of object that associates items as a group, allowing the user to select one item from the group B. Every If statement needs one of these coordinating statements C. A conditional expression tested uses this kind of operator to evaluate to either true or false D. An easier and clearer alternative to using a series of If…Then…ElseIf statements E. When this kind of object is contained in a group box, the user can select only one of these objects F. Message boxes can display these to represent the type of message being displayed G. Keyword that you must use in a Select Case statement that uses relational operators H. Function that returns a Boolean value I. Multiple conditions can be tested using this kind of statement J. The kind of statement between the If keyword and the Then keyword in an If...Then statement

Computer Science & Information Technology