GUI Controls Part 2 - Quiz

computer science

Description

Week 3: GUI Controls Part 2 - Quiz

Question 1.1. (TCOs 1, 4, and 6) Which of the following would be an appropriate use of a check box

control? (Points : 3)

       Marital status (single, married)

       Gender (male, female)

       Insurance benefits (health, vision, dental)

       Either marital status (single, married) or gender (male, female)


Question 2.2. (TCOs 1, 4, and 6) The maximum number of radio buttons that can be selected within a

ButtonGroup is (Points : 3)

       1.

       2.

       5.

       all.


Question 3.3. (TCOs 1, 4, and 6) The isSelected() method of a radio button returns the value _____ if

that button is on. (Points : 3)

       checked

       true

       false

       selected


Question 4.4. (TCOs 1, 4, and 6) The getSelectedText method of the JTextArea component (Points :

3)

       returns all the text in the JTextArea.

       sets the selected text in the JTextArea.

       returns the selected text in the JTextArea.

       sets the text in the JTextArea.


Question 5.5. (TCOs 1, 4, and 6) Pressing a button generates a(n) _____ event. (Points : 3)

       Objectevent


       ClickEvent

       ActionEvent

       MouseEvent


Question 6.6. (TCOs 1, 4, and 6) Complex layouts are often created in Java GUIs by using multiple

_____ components. (Points : 3)

       JLayout

       JPanel

       FlowLayout

       GridLayout


Question 7.7. (TCOs 1, 4, and 6) Menus are attached to windows by calling the _____

method. (Points : 3)

       addMenuBar

       setJMenuBar

       setMenu

       addJMenuBar


Question 8.8. (TCOs 1, 4, and 6) Which of the following statements is false? (Points : 3)

       All the methods in JRadioButton are inherited from javax.swing.AbstractButton.

       You can use an icon on JRadioButton.

       Multiple radio buttons can be selected within a ButtonGroup.

       All of the methods in JRadioButton are also in JButton.


Question 9.9. (TCOs 1, 4, and 6) If a keyboard shortcut is created for a menu item, the shortcut or

mnemonic character to be used is indicated in the menu’s name using (Points : 3)

       underline.

       bold.

       italic.

       a different font.


Question 10.10. (TCOs 1, 4, and 6) Given a JTextField txtData and a JTextArea txtMessage that have

been properly created, what statement will take the text in txtData and display it is txtMessage along

with whatever is already there? (Points : 3)

       txtMessage.setText(txtData.setText());


       txtMesage.setText(txtData.getText());

       txtMessage.append(txtData.getText());

       txtMessage.append(txtData.setText());


Related Questions in computer science category


Disclaimer
The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.