... broad range of com-
puting issues, laying the founda-
tion for the study of software
development.
◗ Describe the relationship between
hardware and software.
◗ Define various types of software
and ... Hardware
and software cooperate in a
computer system to accomplish
complex tasks. The nature of
that cooperation and the purpose
of various hardware components
are important prerequisites to
the study of ... For example, high values of red and green combined
with a low level of blue results in a shade of yellow.
In the graphics sections of other chapters we explore the use of color and how
to control...
... can be thought of as a segment of an oval. To
draw an arc, we specify the oval of which the arc is a part
and the portion of the oval in which we’re interested. The
starting point of the arc is ... the structure of a Java applet
and the structure of a Java application. Because the Web browser that executes
an applet is already running, applets can be thought of as a part of a larger pro-
gram. ... them.
2.4 A string literal is a sequence of characters delimited by double
quotes.
2.5 Both the print and println methods of the System.out object
write a string of characters to the monitor screen....
... the
details of class definitions,
including the structure and
semantics of methods and the
scope and encapsulation of data.
◗ Define classes that serve as blue-
prints for new objects, composed
of variables ...
◗ Explain the advantages of encapsu-
lation and the use of Java modifiers
to accomplish it.
◗ Explore the details of method
declarations.
◗ Revisit the concepts of method
invocation and parameter ... methods. The header of a
method includes the type of the return value, the method name, and a list of
parameters that the method accepts. The statements that make up the body of the
method are...
... all instances of a class. There is only one copy of a static
variable for all objects of a class. Therefore, changing the value of a
static variable in one object changes it for all of the others. ... the Swing version of the Applet class
that we’ve used previously.
A push button is a component that allows the user to initiate an action with a
press of the mouse. A label is a component that displays ... modifier, are also often
declared using the static modifier as well. Because the value of constants can-
not be changed, there might as well be only one copy of the value across all
objects of the class.
static...
... represents a generic type of food.
The constructor of FoodItem accepts the number of grams of fat and the number
of servings of that food. The calories method returns the number of calories
due to fat, ... Susan
Number of courses: 5
Student name: Frank
Number of courses: 3
Support source: GTA
Hourly pay rate: 12.75
These are two different students.
output
the way we design object-
oriented software. ... the pro-
cessing of a selection sort. Use bars of various heights to represent
the values being sorted. Display the set of bars after each swap. Put
a delay in the processing of the sort to give...
... for different types
of data. For example, they both provide a basic read method. The read method
of Reader reads one character or an array of characters; the read method of
InputStream reads ... class
A timer object, created from the Timer class of the javax.swing package, can be
thought of as a GUI component. However, unlike other components, it does not
494 CHAPTER 8 exceptions and ... main (String[] args) throws OutOfRangeException
{
final int MIN = 25, MAX = 40;
OutOfRangeException problem =
new OutOfRangeException ("Input value is out of range.");
System.out.print...
... to any component. Each component
generates a certain set of events, and only listeners of those types can
be added to the component.
592 CHAPTER 10 software engineering
The detailed design and ... the
maintenance tasks, and often the responsibilities of personnel change.
Therefore, maintainers often do not understand the software as well as
Maintaining software is the
process of modifying a pro-
gram ... of component/ event/listener interaction is often just a matter of
knowing which components generate which events under which circumstances.
figure 9.13 Specific events generated by specific components
JButton
JCheckBox
JColorChooser
JComboBox
JDialog
JEditorPane
JFileChooser
JFrame
JInternalFrame
JList
JMenu
JMenuItem
JOptionPane
JPasswordField
JPopupMenu
JProgessBar
JRadioButton
JSlider
JTabbedPane
JTable
JTextArea
JTextField
JTextPane
JToggleButton
JTree
Action
Component
Caret...