Ebooka przeczytasz w aplikacjach Legimi na:
Odsłuch ebooka (TTS) dostępny w abonamencie „ebooki+audiobooki bez limitu” w aplikacji Legimi na:
Java - GUI Applications
Published by Gaurav Gaurav, 2018.
While every precaution has been taken in the preparation of this book, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information contained herein.
JAVA - GUI APPLICATIONS
First edition. November 8, 2018.
Copyright © 2018 Preeti Man.
Written by Preeti Man.
10 9 8 7 6 5 4 3 2 1
Gaddis – Starting Out With Java 5 – From Control Structures to Objects | Chapter 13–Advanced GUI Applications | Multiple Choice
1. ____ is a library of classes that do not replace ____, but provide an improved alternative for creating GUI applications.
a. AWT, Swing
b. Swing, AWT
c. JFC, AWT
d. JFC, Swing
2. Programs that operate in a GUI environment must be
a. Event driven
b. In color
c. Dialog boxes
d. Layout managers
7. To use the ActionListener interface, as well as other event listener interfaces, you must have the following import statement in your code:
a. import java.swing;
b. import java.awt;
c. import java.awt.*;
d. import java.awt.event.*;
8. Assume that message, contentPane, and panel have been created and initialized. In what order would you execute the following statements to display message on a JFrame object?
a. 1, 2, 3, 4
b. 2, 1, 3, 4
c. 3, 4, 1, 2
d. 1, 3, 4, 2
9. When you write an action listener class for a JButton component, it must
a. Have a method named actionPerformed
b. Implement the ActionLIstener interface
c. The method actionPerformed must take an argument of the ActionEvent type
d. All of the above
10. A common technique for writing an event listener class is to write it as a private inner
class inside the class that creates the GUI.
11. In a Swing application, you create a frame object from the
a. Jlabel class.
b. JFrame class.