System, but they may not be reproduced for publication



Yüklə 83 Mb.
Pdf görüntüsü
səhifə72/82
tarix19.04.2023
ölçüsü83 Mb.
#106251
1   ...   68   69   70   71   72   73   74   75   ...   82
Java A Beginner’s Guide, Eighth Edition ( PDFDrive )

 Chapter 15 Self Test
1.
In general terms, modules give you a way to specify when one unit of code depends
on another. True or False?
2.
A module is declared using what keyword?
3.
The keywords that support modules are context sensitive. Explain what this means.
4.
What is module­info.java and why is it important?
5.
To declare that one module depends on another module, what keyword do you use?


6.
To make the public members of a package accessible outside the module in which it
is contained, it must be specified in an _________ statement.
7.
When compiling or running a module­based application, why is the module path
important?
8.
What does requires transitive do?
9.
Does an exports statement export another module, or does it export a package?
10.
In the first module example, if you remove
from the appfuncs module­info file and then attempt to compile the program, what
error do you see?
11.
Module­based services are supported by what keywords?
12.
A service specifies the general form of a unit of program functionality using either
an interface or abstract class. True or False?
13.
A service provider ____________ a service.
14.
To load a service, what class do you use?
15.
Can a module dependency be made optional at run time? If so, how?
16.
Briefly describe what open and opens do.


Chapter 16
Introducing Swing
Key Skills & Concepts

Know the origins and design philosophy of Swing

Understand Swing components and containers

Know layout manager basics

Create, compile, and run a simple Swing application

Learn event handling fundamentals
History
Topics
Tutorials
Offers & Deals
Highlights
Settings
Support
Sign Out


S

Use JButton

Work with JTextField

Create a JCheckBox

Work with JList

Use anonymous inner classes or lambda expressions to handle events
o far, all of the programs in this book have been console­based. This means that they do
not make use of a graphical user interface (GUI). Although console­based programs are
excellent for teaching the basics of Java and for some types of programs, such as server­
side code, most real­world client applications will be GUI­based. At the time of this
writing, the most widely used Java GUI is Swing.
Swing defines a collection of classes and interfaces that support a rich set of visual
components, such as buttons, text fields, scroll panes, check boxes, trees, and tables, to
name a few. Collectively, these controls can be used to construct powerful, yet easy­to­
use graphical interfaces. Because of its widespread use, Swing is something with which
all Java programmers should be familiar. Therefore, this chapter provides an
introduction to this important GUI framework.
It is important to state at the outset that Swing is a very large topic that requires an
entire book of its own. This chapter can only scratch its surface. However, the material
presented here will give you a general understanding of Swing, including its history,
basic concepts, and design philosophy. It then introduces five commonly used Swing
components: the label, push button, text field, check box, and list. Although this
chapter describes only a small part of Swing’s features, after completing it, you will be
able to begin writing simple GUI­based programs. You will also have a foundation upon
which to continue your study of Swing.

Yüklə 83 Mb.

Dostları ilə paylaş:
1   ...   68   69   70   71   72   73   74   75   ...   82




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə