Java - GUI Applications - Preeti Man - ebook
Opis

This book intends to educate Java practitioners on GUI Applications through questions and answers based on various interviews and personnel questions.

Ebooka przeczytasz w aplikacjach Legimi na:

Androidzie
iOS
czytnikach certyfikowanych
przez Legimi
Windows
10
Windows
Phone

Liczba stron: 16

Odsłuch ebooka (TTS) dostepny w abonamencie „ebooki+audiobooki bez limitu” w aplikacjach Legimi na:

Androidzie
iOS

Popularność


Java - GUI Applications

Preeti Man

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

Table of Contents

Title Page

Copyright Page

Multiple Choice

Gaddis – Starting Out With Java 5 – From Control Structures to Objects | Chapter 13–Advanced GUI Applications | Multiple Choice

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

ANS: B

2. Programs that operate in a GUI environment must be

a. Event driven

b. In color

c. Dialog boxes

d. Layout managers

ANS: A

––––––––

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.*;

ANS: D

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?

1. panel.add(message);

2. setVisible(true);

4. contentPane.add(panel);

a. 1, 2, 3, 4

b. 2, 1, 3, 4

c. 3, 4, 1, 2

d. 1, 3, 4, 2

––––––––

panel.add(message);

contentPane.add(panel);

setVisible(true);

ANS: D

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

ANS: D

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.

a. True

b. False

ANS: A

11. In a Swing application, you create a frame object from the

a. Jlabel class.

b. JFrame class.