Interpersonal Communication Review

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

Both AWT classes and Swing classes ultimately inherit from the Component class. a) True b) False

A

Programs that operate in a GUI environment must be: a) Event driven. b) In color. Incorrect Response c) Dialog boxes. d) Layout managers.

A

The ImageIcon class supports all the following file types, except: Correct Response a) BMP b) JPEG c) GIF d) PNG

A

The JMenuBar method is a(n): Correct Response a) JFrame method. b) JPanel method. c) JMenu method. d) JTextComponent method.

A

The ability to catch multiple types of exceptions with a single catch is known as ________, and was introduced in Java 7. Correct Response a) multi-catch b) super catch c) exception trapping d) compound catch

A

To read data from a binary file, you create objects from the following classes: Correct Response a) FileInputStream and DataInputStream b) File and PrintWriter c) File and Scanner d) BinaryFileReader and BinaryDataReader

A

Unchecked exceptions are those that inherit from: Correct Response a) The Error class or the RuntimeException class. b) The Error class or the Exception class. c) The Exception Class or the RuntimeException class. d) Only the Error class.

A

When a JList component is added to a JScrollPane object, a border will automatically appear around the list. a) True b) False

A

When using a slider, by default, tick marks are not displayed, and setting their spacing does not cause them to be displayed. a) True b) False

A

When using the BorderLayout manager, how many components can each region hold? a) 1 b) 2 c) 5 d) No limit

A

When you write a change listener class method for a slider, it must implement the ChangeListener interface which is in the javax.swing.event package. a) True b) False

A

When you write a method that throws a checked exception, you must: a) Have a throws clause in the method header. b) Override the default error method. c) Use each class only once in a method. d) Ensure that the error will occur at least once each time the program is executed.

A

Which of the following does not belong in a JavaFX scene graph? Correct Response A) Trunk node B) Leaf node C) Branch node D) Root node

A

Which one of the following GUI components is considered to be a container? a) Frame b) Label c) Slider d) Button

A

You can create a label with an image, or with both an image and text. a) True b) False

A

A label's preferred size is determined only by calling the setPreferredSize method. a) True b) False

B

A(n) ________ is an object that is generated in memory as the result of an error or an unexpected event. A. Exception handler B. Exception C. Default Exception handler D. Error Message

B

All exceptions are instances of classes that extend this class. A. RunTimeException B. Throwable C. Error D. Exception

B

Because these components rely on the appearance and behavior of the underlying operating system components, there is little that can be done by the programmer to change their properties. a) Swing b) AWT c) Container d) JFC

B

The GridLayout manager limits each cell to only one component. To put two or more components in a cell, do this: a) Resize the cells so they can hold more. b) You can nest panels inside the cells and add other components to the panels. c) The statement is false; the GridLayout manager does not have this restriction. d) Resize the components to fit in the cell.

B

The IllegalArgumentException class extends the RuntimeException class, and is therefore: a) A checked exception class. Correct Response b) An unchecked exception class. c) Never used directly. d) None of these.

B

This is a name that identifies a component in the FXML file and will also become a variable name that you can use later in the Java code that you will write to run the application. A) FXID B) fx:id C) fx.URL D) fx_id

B

This is a specialized dialog box that allows the user to select a color from a predefined palette of colors. a) Hue picker b) Color chooser c) Paint dialog box d) Palette selector

B

This is commonly used to hold and organize collections of related components. a) List b) Panel c) Frame d) Label

B

This variable references the window that the GUI will be displayed in. A) frame B) stage C) window D) component

B

To change the image being displayed in an ImageView component as the application is running, you pass a reference to an Image object as an argument to this method. A) showImage B) setImage C) addImage D) replaceImage

B

What will be the results of executing the following statements? x.setEditable(true); x.setText("Tiny Tim"); a) The text field x will have the value "Tiny Tim" and be read-only. b) The text field x will have the value "Tiny Tim" and the user will be able to change its value. c) The text field x will have the value true. d) The text field x have the value "trueTiny Tim".

B

What will display when the following code is executed? JLabel label = new JLabel ("It is a beautiful morning."); labed.setIcon(SunnyFace.gif); a) A label with the text "It is a beautiful day." to the left of the SunnyFace image b) A label with the text "It is a beautiful day." to the right of the SunnyFace image c) A label with the text "It is a beautiful day." below the SunnyFace image d) A label with the text "It is a beautiful day." above the SunnyFace image

B

A text field that can be changed by code in the application, but cannot be edited by the user is known as what? a) Write-only b) Static c) Read-only d) Formal

C

If a user enters a value in the text box of an editable combo box and the value is not in the list, what will the method getSelectedIndex return? a) The index of the item that the user replaced. b) The index of the item the user entered. c) -1 d) 0, since the item is not in the list.

C

If the letter chosen as the mnemonic is in the component's text, the first occurrence of that letter will appear ________ when the component is displayed. a) bolded b) italicized c) underlined d) All of these

C

In JavaFX, this component is commonly used as a GUI's root node. A) List B) ComboBox C) AnchorPane D) Button

C

In Swing, labels are created with this class: a) JFCLabel b) AWTLabel c) JLabel d) SwingLabel

C

In the controller class, you can use the RadioButton's ________ method to determine whether the RadioButton is selected or not. A) isPushed B) isChecked C) isSelected D) getIndex

C

The default selection mode for a JList component is: a) Single selection. b) Single interval selection. c) Multiple interval selection. d) There is no default setting.

C

The following catch statement: catch (Exception e) {} A. Can handle all exceptions that are instances of the Exception class, but not a subclass of Exception. B. Can handle all throwable objects by using polymorphic reference as a parameter in the catch clause. C. Can handle all exceptions that are instances of the Exception class or a subclass of Exception. D. Is an error since no objects are instantiated in the Exception class.

C

These components have a consistent look and predictable behavior on any operating system. a) AWT b) GUI c) Swing d) Peer classes

C

This layout manager arranges components in rows. Incorrect Response a) GridLayout b) BorderLayout c) FlowLayout d) RegionLayout

C

This section of the Inspector Panel allows you to register the controller class and event listeners with the GUI. A) Properties B) Layout C) Code D) Content

C

To determine which item in a list is currently selected use: a) The getSelectedIndex method. b) The getSelectedValue method. c) Both The getSelectedIndex method and The getSelectedValue method. d) Neither The getSelectedIndex method nor The getSelectedValue method.

C

When an exception is thrown: A. It must always be handled by the method that throws it. B. The program terminates even if the exception is handled. C. It must be handled by the program or by the default exception handler. D. It may be ignored.

C

When an item in the combo box is selected, the combo box executes its action event listener's actionPerformed method, passing: a) An ItemEvent object as an argurment. b) A SelectionEvent object as an argurment. c) An ActionEvent object as an argument. d) The combo box as an argument.

C

Which of the following assigns ALT+C as a mnemonic key for the JButton object, clearButton? a) clearButton.addMnemonic(KeyEvent.VK_C); b) clearButton.setMnemonic(KeyEvent.C); c) clearButton.setMnemonic(KeyEvent.VK_C); d) clearButton.assignMnemonic(KeyEvent.VK_C);

C

A menu system may consist of each of the following except: a) Menu item. b) Separator bar. c) Menu bar. d) It may have all of these.

D

The Application class's ________ method is the main entry point for a JavaFx application. A) mainFX B) addWindow C) init D) start

D

The ________ is responsible for handling events that occur while the JavaFX application is running. A) abstract class B) main application class C) super class D) controller class

D

The catch clause: a) Follows the try clause. b) Starts with the word catch followed by a parameter list in parentheses containing an ExceptionType parameter variable. c) Contains code to gracefully handle the exception type listed in the parameter list. Correct Response d) All of these.

D

When an item in a Jlist object is selected it generates a(n): a) Action listener event. b) Action performed event. c) List selection listener event. d) List selection event.

D

When you write an action listener class for a JButton component, it must: a) Have a method named buttonClicked. b) Implement the ActionListener interface. c) Have a method named ActionPerformed which must take an argument of the ActionEvent type. d) Both Implement the ActionListener interface and Have a method named ActionPerformed which must take an argument of the ActionEvent type.

D

Which of the following is TRUE concerning the sample controller skeleton provided by Scene Builder? A) It has private field declarations for all of the components that have an fx:id. B) You just need to change the name of the class, and write the code for the event listener methods. C) It has all of the necessary import statements. D) All of the above

D

Most exceptions are derived from what class

Exception

A section of code that gracefully responds to exceptions

Exception handler


संबंधित स्टडी सेट्स

Physical Activity Benefits- Lesson 3

View Set

STATS 212 - CHAPTER 4 LEARNING CHECKS

View Set

Lecture - 13 : Artificial Intelligence

View Set

The Call of the Wild Chapter 4 Vocabulary Practice

View Set

Inquizitive - Chapters 13, 14, and 15 Western Civ.

View Set

Layers Of The Earth and Plate Tectonics

View Set