NATIONAL UNIVERSITY OF SINGAPORE
School
of Computing
CS3283
: GUI Programming – Quiz on GUI Basics & Swing (6%)
(Semester
II, 2001)
This quiz, as a warm-up
exercise to your mid-term, consists of 12 multiple-choice questions printed on
4 pages. The questions are NOT ordered in increasing order of difficulty NOR
sequential order of topics covered. You have to submit your clearly written answers printed on
these question sheets ONLY. Make sure you fill in your full name and matric.
no. before submission.
Full Name : ______________________________________________
Matriculation Number : ______________________________________________
Total Marks : = ____________
(1)
For
JFC Swing library, lightweight components depend on the local windowing
toolkit.
(a)
true
(b)
false
(c)
difficult
to conclude, depending on your windowing environment and the set of toolkit
used
(d)
none of the
above
ans : _______b______________
(2) Why is the JFC Swing more
accurately described as a model-delegate architecture?
(a)
Accessor
methods in container classes let you manipulate the model (data).
(b)
The user
interface is completely separate from the controller.
(c)
The Project
Swing data model is delegated to an underlying servlet.
(d)
The
controller part of a Project Swing interface, often the mouse and keyboard events
the component responds to, is combined
with the physical view in one user interface delegate object.
(e)
none of the
above
ans : _________d____________
(3) Which of the following is/are
correct observation(s) about the event handling mechanism used in JFC Swing ?
(a)
JFC Swing always produces frozen GUI due to inefficient event handling
mechanism;
(b)
JFC Swing’s event handling capability is often degraded by the newly
introduced look-n-feel technology;
(c)
JFC Swing’s event handling capability is close to the event-loop
mechanism used in conventional event-driven programming;
(d)
JFC Swing’s event handling capability is similar to the callback
mechanism used in event-driven programming;
(e)
JFC Swing’s event handling efficiency is much improved with the newly
introduced multi-casting technology;
ans : __________d___________
(4)
JApplet,
JDialog, JFrame, and JWindow are examples of heavyweight components. Is this
statement valid ?
(a)
valid
(b)
invalid
(c)
hard to
tell – depends on the windows environment
(d)
none of the
above
(e)
none of the
above
ans : _________a____________
(5) Which of the following is/are
not user events ?
(a)
Mouse clicks
(b)
Clock ticks
(c)
Window got
focused
(d)
System
interrupt
(e)
Window
resized
ans : _________b, d__________
(6)
Which
of the following should not be our original intention(s) to
make GUI easy-to-use ?
(a)
Reducing
the training cost
(b)
Replacing
all the printed user manuals completely
(c)
Increasing
job efficiency
(d)
Increasing
job satisfaction
(e)
Reducing
the dependence on humans
ans : _____b,e______________
(7) Which of the following way(s)
is/are being used to register an event listener to attend to a event source ?
(a)
uses
setEventTypeListener() for the event listener
(b)
uses
addEventListener() to register with the source
(c)
uses
setEventListener() for the event listener
(d)
uses
addEventTypeListener() to register with the source
(e)
none of the
above
ans : ______a,d____________
(8) Under
the Model-View-Controller design pattern of JFC/Swing, you can define a
TableModel object as the Model. Then, which of the following is/are correct
observations related to this TableModel object?
(a)
Users are
free to define multiple Views (JTable) to monitor the same TableModel object;
(b)
The
TableModel object can only notify one View of its change;
(c)
It is the
responsibility of each View (JTable) to prompt the TableModel object for its
latest change/update;
(d)
Users can
only define ONE View for Each TableModel object;
(e)
None of the
above
ans : ___________a__________
(9) The major factor which often
attributes to the slow performance of Swing components is ?
(a)
Most Swing
components take up lots of computational resources at runtime
(b)
Most Swing
components are ad-hocly designed, thus not suitable for large-scale software
development
(c)
Users are
not using Swing components properly
(d)
Users are
always too demanding and require very complicated GUI components to be used
together
(e)
None of the
above
ans : _________c____________
(10)
In
general, Swing has two kinds of classes. What are they ?
(a)
Event and
model classes
(b)
AWT and
Swing classes
(c)
Text and
Button classes
(d)
UI and
non-UI classes
ans : ______d_______________
(11)
Which
Swing component lets you draw hierarchical data?
(a)
JApplet
(b)
JTree
(c)
JList
(d)
JFileChooser
ans : __________b___________
(12)
Which
of the following statement(s) is/are true about Swing components?
(a)
When a
lightweight and heavyweight component overlap, the lightweight component is always
on top.
(b)
A lightweight component can have transparent
pixels, and a
heavyweight component is always opaque.
(c)
A
lightweight component can only be rectangular.
(d)
A mouse
event on a heavyweight component falls through to its parent.
ans : __________b___________
-------------END OF PAPER-------------