100% found this document useful (14 votes)
49 views

Full Download Java Programming 5th Edition Joyce Farrell PDF DOCX

Joyce

Uploaded by

lateympr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (14 votes)
49 views

Full Download Java Programming 5th Edition Joyce Farrell PDF DOCX

Joyce

Uploaded by

lateympr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 60

Download the full version of the ebook at ebookname.

com

Java Programming 5th Edition Joyce Farrell

https://ebookname.com/product/java-programming-5th-edition-
joyce-farrell/

OR CLICK BUTTON

DOWNLOAD EBOOK

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

Programming Logic and Design Comprehensive 6th Edition


Joyce Farrell

https://ebookname.com/product/programming-logic-and-design-
comprehensive-6th-edition-joyce-farrell/

ebookname.com

Object Oriented Programming Using C Fourth Edition Joyce


Farrell

https://ebookname.com/product/object-oriented-programming-using-c-
fourth-edition-joyce-farrell/

ebookname.com

Just Enough Programming Logic and Design 1st Edition Joyce


Farrell

https://ebookname.com/product/just-enough-programming-logic-and-
design-1st-edition-joyce-farrell/

ebookname.com

Space Systems Failures Disasters and Rescues of Satellites


Rockets and Space Probes 1st Edition David M. Harland

https://ebookname.com/product/space-systems-failures-disasters-and-
rescues-of-satellites-rockets-and-space-probes-1st-edition-david-m-
harland/
ebookname.com
Data Gathering Analysis and Protection of Privacy Through
Randomized Response Techniques Qualitative and
Quantitative Human Traits 1st Edition Arijit Chaudhuri
https://ebookname.com/product/data-gathering-analysis-and-protection-
of-privacy-through-randomized-response-techniques-qualitative-and-
quantitative-human-traits-1st-edition-arijit-chaudhuri/
ebookname.com

Essentials of Business Communication Book Only Eighth


Edition Mary Ellen Guffey

https://ebookname.com/product/essentials-of-business-communication-
book-only-eighth-edition-mary-ellen-guffey/

ebookname.com

Nationalism in Europe since 1945 1st Edition André Gerrits

https://ebookname.com/product/nationalism-in-europe-since-1945-1st-
edition-andre-gerrits/

ebookname.com

Beginning XML 5th Edition Joe Fawcett

https://ebookname.com/product/beginning-xml-5th-edition-joe-fawcett/

ebookname.com

Student Solutions Manual for Brase Brase s Understanding


Basic Statistics Brief 4th 4th Edition Charles Henry Brase

https://ebookname.com/product/student-solutions-manual-for-brase-
brase-s-understanding-basic-statistics-brief-4th-4th-edition-charles-
henry-brase/
ebookname.com
Emergency Response Guidebook A Guidebook for First
Repsponders During the Initial Phase of a Dangerous Goods
Hazardous Materials Transportation Inc 1st Edition Us
Deparment Of Transportation
https://ebookname.com/product/emergency-response-guidebook-a-
guidebook-for-first-repsponders-during-the-initial-phase-of-a-
dangerous-goods-hazardous-materials-transportation-inc-1st-edition-us-
deparment-of-transportation/
ebookname.com
Java Programming
Fifth Edition
Joyce Farrell

Australia • Brazil • Japan • Korea • Mexico • Singapore • Spain • United Kingdom • United States
Java Programming, Fifth Edition © 2010 Course Technology, Cengage Learning
Joyce Farrell
ALL RIGHTS RESERVED. No part of this work covered by the copyright herein
Executive Editor: Marie Lee may be reproduced, transmitted, stored, or used in any form or by any means—
graphic, electronic, or mechanical, including but not limited to photocopying,
Acquisitions Editor: Amy Jollymore
recording, scanning, digitizing, taping, Web distribution, information networks, or
Managing Editor: Tricia Coia information storage and retrieval systems, except as permitted under Section
Development Editor: Dan Seiter 107 or 108 of the 1976 United States Copyright Act—without the prior written
permission of the publisher.
Editorial Assistant:
Julia Leroux-Lindsey
For product information and technology assistance, contact us at
Marketing Manager: Bryant Chrzan Cengage Learning Customer & Sales Support, 1-800-354-9706
Content Project Manager: For permission to use material from this text or product,
Heather Furrow submit all requests online at www.cengage.com/permissions
Art Director: Marissa Falco Further permissions questions can be e-mailed to
permissionrequest@cengage.com
Cover Designer: Bruce Bond
Cover Photo: TBD
Microsoft® is a registered trademark of the Microsoft Corporation.
Manufacturing Coordinator:
Julio Esperas ISBN-13: 978-0-3245-9951-0

Proofreader: Andrea Schein ISBN-10: 0-3245-9951-X


Indexer: Elizabeth Cunningham
Course Technology
Compositor: International Typesetting 25 Thomson Place
and Composition Boston, MA 02210
USA

Cengage Learning is a leading provider of customized learning solutions with


office locations around the globe, including Singapore, the United Kingdom,
Australia, Mexico, Brazil, and Japan. Locate your local office at:
www.international.cengage.com/region

Cengage Learning products are represented in Canada by Nelson Education, Ltd.

To learn more about Course Technology, visit


www.cengage.com/coursetechnology
Purchase any of our products at your local bookstore or at our preferred online
store www.ichapters.com
Some of the product names and company names used in this book have been
used for identification purposes only and may be trademarks or registered
trademarks of their respective manufacturers and sellers.
Course Technology, a part of Cengage Learning, reserves the right to revise this
publication and make changes from time to time in its content without notice.

Printed in Canada
1 2 3 4 5 6 7 12 11 10 09 08
BRIEF CONTENTS
PREFACE xix
READ THIS BEFORE YOU BEGIN xxv

CHAPTER 1 CREATING YOUR FIRST JAVA CLASSES 1


CHAPTER 2 USING DATA WITHIN A PROGRAM 43
CHAPTER 3 USING METHODS, CLASSES, AND OBJECTS 89
CHAPTER 4 MORE OBJECT CONCEPTS 135
CHAPTER 5 MAKING DECISIONS 187
CHAPTER 6 LOOPING 233
CHAPTER 7 CHARACTERS, STRINGS, AND THE STRINGBUILDER 273
CHAPTER 8 ARRAYS 309
CHAPTER 9 INTRODUCTION TO INHERITANCE 369
CHAPTER 10 ADVANCED INHERITANCE CONCEPTS 413
CHAPTER 11 EXCEPTION HANDLING 461
CHAPTER 12 FILE INPUT AND OUTPUT 525
CHAPTER 13 INTRODUCTION TO SWING COMPONENTS 587
CHAPTER 14 ADVANCED GUI TOPICS 641
CHAPTER 15 GRAPHICS 709
CHAPTER 16 APPLETS, IMAGES, AND SOUND 763
APPENDIX A WORKING WITH THE JAVA PLATFORM 807
APPENDIX B LEARNING ABOUT ASCII AND UNICODE 815
APPENDIX C FORMATTING OUTPUT 821
APPENDIX D GENERATING RANDOM NUMBERS 833
APPENDIX E JAVADOC 839
GLOSSARY 847
INDEX 867

iii
This page intentionally left blank
CONTENTS
PREFACE xix
READ THIS BEFORE YOU BEGIN xxv

CHAPTER 1 CREATING YOUR FIRST JAVA CLASSES 1


LEARNING ABOUT PROGRAMMING 2
INTRODUCING OBJECT-ORIENTED PROGRAMMING CONCEPTS 4
Procedural Programming 4
Object-Oriented Programming 4
Understanding Objects, Classes, and Encapsulation 5
Understanding Inheritance and Polymorphism 7
LEARNING ABOUT JAVA 8
Java Program Types 9
ANALYZING A JAVA APPLICATION THAT USES CONSOLE OUTPUT 10
Understanding the Statement That Prints the Output 10
Understanding the First Class 11
Understanding the main() Method 14
ADDING COMMENTS TO A JAVA CLASS 16
SAVING, COMPILING, RUNNING, AND MODIFYING A JAVA APPLICATION 18
Saving a Java Class 18
Compiling a Java Class 18
Running a Java Application 19
Modifying a Java Class 19
CREATING A JAVA APPLICATION USING GUI OUTPUT 21
CORRECTING ERRORS AND FINDING HELP 23
YOU DO IT 26
Your First Application 26
Adding Comments to a Class 27
Modifying a Class 28
Creating a Dialog Box 29
DON’T DO IT 30
KEY TERMS 31
CHAPTER SUMMARY 34
REVIEW QUESTIONS 35
EXERCISES 37

v
CONTENTS

DEBUGGING EXERCISES 39
GAME ZONE 39
TOUGH QUESTIONS 40
UP FOR DISCUSSION 41

CHAPTER 2 USING DATA WITHIN A PROGRAM 43


USING CONSTANTS AND VARIABLES 44
Declaring Variables 45
Declaring Named Constants 46
Pitfall: Forgetting That a Variable Holds One Value at a Time 48
LEARNING ABOUT THE int DATA TYPE 48
DISPLAYING DATA 50
WRITING ARITHMETIC STATEMENTS 51
Writing Arithmetic Statements Efficiently 53
USING THE BOOLEAN DATA TYPE 54
LEARNING ABOUT FLOATING-POINT DATA TYPES 55
UNDERSTANDING NUMERIC-TYPE CONVERSION 56
WORKING WITH THE char DATA TYPE 58
USING THE Scanner CLASS FOR KEYBOARD INPUT 61
Pitfall: Using nextLine() Following One of the Other Scanner
Input Methods 63
USING THE JOptionPane CLASS FOR GUI INPUT 66
Using Input Dialog Boxes 66
Using Confirm Dialog Boxes 70
YOU DO IT 72
Working with Numeric Values 72
Accepting User Data 73
Performing Arithmetic 74
Experimenting with Java Programs 75
DON’T DO IT 76
KEY TERMS 77
CHAPTER SUMMARY 80
REVIEW QUESTIONS 81
EXERCISES 83
DEBUGGING EXERCISES 86
GAME ZONE 86
TOUGH QUESTIONS 86
UP FOR DISCUSSION 87

vi
CONTENTS

CHAPTER 3 USING METHODS, CLASSES, AND OBJECTS 89


CREATING METHODS WITH ZERO, ONE, AND MULTIPLE PARAMETERS 90
Creating Methods That Require a Single Parameter 94
Creating Methods That Require Multiple Parameters 97
CREATING METHODS THAT RETURN VALUES 99
Calling a Method from Another Method 101
LEARNING ABOUT CLASS CONCEPTS 102
CREATING A CLASS 104
CREATING INSTANCE METHODS IN A CLASS 106
DECLARING OBJECTS AND USING THEIR METHODS 109
Understanding Data Hiding 110
ORGANIZING CLASSES 112
AN INTRODUCTION TO USING CONSTRUCTORS 114
UNDERSTANDING THAT CLASSES ARE DATA TYPES 116
YOU DO IT 118
Creating a Static Method That Requires No Arguments and Returns No Values 118
Calling a Static Method from Another Class 119
Creating a Static Method That Accepts Arguments and Returns Values 120
Creating a Class That Contains Instance Fields and Methods 122
Creating a Class That Instantiates Objects of Another Class 123
Adding a Constructor to a Class 124
Creating a More Complete Class 124
DON’T DO IT 125
KEY TERMS 125
CHAPTER SUMMARY 127
REVIEW QUESTIONS 128
EXERCISES 131
DEBUGGING EXERCISES 133
GAME ZONE 133
TOUGH QUESTIONS 134
UP FOR DISCUSSION 134

CHAPTER 4 MORE OBJECT CONCEPTS 135


UNDERSTANDING BLOCKS AND SCOPE 136
OVERLOADING A METHOD 142
LEARNING ABOUT AMBIGUITY 144
SENDING ARGUMENTS TO CONSTRUCTORS 147
OVERLOADING CONSTRUCTORS 148

vii
CONTENTS

LEARNING ABOUT THE this REFERENCE 149


Using the this Reference to Make Overloaded Constructors More Efficient 152
USING static VARIABLES 154
USING CONSTANT FIELDS 156
USING AUTOMATICALLY IMPORTED, PREWRITTEN CONSTANTS AND METHODS 157
USING AN EXPLICITLY IMPORTED PREWRITTEN CLASS AND ITS METHODS 160
UNDERSTANDING COMPOSITION 164
A BRIEF LOOK AT NESTED AND INNER CLASSES 166
YOU DO IT 168
Demonstrating Scope 168
Overloading Methods 170
Creating a Constructor That Requires an Argument 171
Using an Explicitly Imported Prewritten Class 172
Creating an Interactive Application with a Timer 174
DON’T DO IT 176
KEY TERMS 176
CHAPTER SUMMARY 177
REVIEW QUESTIONS 178
EXERCISES 181
DEBUGGING EXERCISES 184
GAME ZONE 184
TOUGH QUESTIONS 185
UP FOR DISCUSSION 185

CHAPTER 5 MAKING DECISIONS 187


UNDERSTANDING DECISION MAKING 188
MAKING DECISIONS WITH THE if AND if...else STRUCTURES 190
Pitfall: Misplacing a Semicolon in an if Statement 191
Pitfall: Using the Assignment Operator Instead of the Equivalency Operator 192
Pitfall: Attempting to Compare Objects Using the Relational Operators 192
The if...else Structure 193
USING MULTIPLE STATEMENTS IN AN if OR if...else STRUCTURE 194
NESTING if AND if...else STATEMENTS 197
USING LOGICAL AND and OR OPERATORS 199
MAKING ACCURATE AND EFFICIENT DECISIONS 202
Using AND and OR Appropriately 205
USING THE switch STATEMENT 206
USING THE CONDITIONAL AND NOT OPERATORS 209
Using the NOT Operator 210
UNDERSTANDING PRECEDENCE 211

viii
CONTENTS

YOU DO IT 213
Using an if...else 213
Creating an Event Class to Use in a Decision-Making Application 215
Writing an Application that Uses the Event class 216
Using the switch Statement 218
DON’T DO IT 219
KEY TERMS 220
CHAPTER SUMMARY 221
REVIEW QUESTIONS 221
EXERCISES 224
DEBUGGING EXERCISES 229
GAME ZONE 229
TOUGH QUESTIONS 231
UP FOR DISCUSSION 232

CHAPTER 6 LOOPING 233


LEARNING ABOUT THE LOOP STRUCTURE 234
USING A while LOOP TO CREATE A DEFINITE LOOP 235
USING A while LOOP TO CREATE AN INDEFINITE LOOP 239
USING SHORTCUT ARITHMETIC OPERATORS 243
USING A for LOOP 246
LEARNING HOW AND WHEN TO USE A do...while LOOP 248
LEARNING ABOUT NESTED LOOPS 250
IMPROVING LOOP PERFORMANCE 252
Avoiding Unnecessary Operations 253
Considering the Order of Evaluation of Short-Circuit Operators 253
Comparing to Zero 254
Employing Loop Fusion 255
YOU DO IT 256
Writing a Loop to Validate Data Entries 256
Working with Prefix and Postfix Increment Operators 257
Working with Definite Loops 259
Working with Nested Loops 260
DON’T DO IT 261
KEY TERMS 262
CHAPTER SUMMARY 263
REVIEW QUESTIONS 264
EXERCISES 267
DEBUGGING EXERCISES 269

ix
CONTENTS

GAME ZONE 269


TOUGH QUESTIONS 270
UP FOR DISCUSSION 271

CHAPTER 7 CHARACTERS, STRINGS, AND THE STRINGBUILDER 273


IDENTIFYING PROBLEMS THAT CAN OCCUR WHEN YOU MANIPULATE STRING DATA 274
MANIPULATING CHARACTERS 276
DECLARING A String OBJECT 278
COMPARING String VALUES 279
USING OTHER String METHODS 283
CONVERTING Strings TO NUMBERS 286
LEARNING ABOUT THE StringBuilder AND StringBuffer CLASSES 288
YOU DO IT 293
Using String Class Methods 293
Converting a String to an Integer 295
Using StringBuilder Methods 296
DON’T DO IT 297
KEY TERMS 297
CHAPTER SUMMARY 299
REVIEW QUESTIONS 300
EXERCISES 302
DEBUGGING EXERCISES 305
GAME ZONE 305
TOUGH QUESTIONS 307
UP FOR DISCUSSION 308

CHAPTER 8 ARRAYS 309


DECLARING AND INITIALIZING AN ARRAY 310
Initializing an Array 312
USING SUBSCRIPTS WITH AN ARRAY 313
DECLARING AN ARRAY OF OBJECTS 316
SEARCHING AN ARRAY FOR AN EXACT MATCH 318
SEARCHING AN ARRAY FOR A RANGE MATCH 321
PASSING ARRAYS TO AND RETURNING ARRAYS FROM METHODS 323
Returning an Array from a Method 326
MANIPULATING ARRAYS OF Strings 326
SORTING ARRAY ELEMENTS 328
Sorting Arrays of Objects 332

x
CONTENTS

USING TWO-DIMENSIONAL AND MULTIDIMENSIONAL ARRAYS 334


Using the length Field with a Two-Dimensional Array 336
Understanding Ragged Arrays 336
Using Multidimensional Arrays 336
USING THE Arrays CLASS 337
USING THE ArrayList CLASS 341
Understanding the Limitations of the ArrayList Class 343
YOU DO IT 344
Creating and Populating an Array 344
Initializing an Array 345
Using a for Loop to Access Array Elements 346
Creating Parallel Arrays to Eliminate Nested if Statements 346
Creating an Application with an Array of Objects 347
Creating an Interactive Application That Creates an Array of Objects 348
Passing an Array to a Method 350
Using Arrays Class Methods 351
DON’T DO IT 353
KEY TERMS 354
CHAPTER SUMMARY 355
REVIEW QUESTIONS 356
EXERCISES 359
DEBUGGING EXERCISES 363
GAME ZONE 363
TOUGH QUESTIONS 367
UP FOR DISCUSSION 367

CHAPTER 9 INTRODUCTION TO INHERITANCE 369


LEARNING ABOUT THE CONCEPT OF INHERITANCE 370
EXTENDING CLASSES 374
OVERRIDING SUPERCLASS METHODS 376
UNDERSTANDING HOW CONSTRUCTORS ARE CALLED DURING INHERITANCE 377
USING SUPERCLASS CONSTRUCTORS THAT REQUIRE ARGUMENTS 379
ACCESSING SUPERCLASS METHODS 380
Comparing this and super 382
LEARNING ABOUT INFORMATION HIDING 382
METHODS YOU CANNOT OVERRIDE 385
A Subclass Cannot Override static Methods in Its Superclass 385
A Subclass Cannot Override final Methods in Its Superclass 388
A Subclass Cannot Override Methods in a final Superclass 390

xi
CONTENTS

YOU DO IT 391
Creating a Superclass and an Application to Use It 391
Creating a Subclass and an Application to Use It 393
Creating a Subclass Method That Overrides a Superclass Method 395
Understanding the Role of Constructors in Inheritance 397
Inheritance When the Superclass Requires Constructor Arguments 398
Accessing an Overridden Superclass Method from Within a Subclass 401
DON’T DO IT 402
KEY TERMS 402
CHAPTER SUMMARY 403
REVIEW QUESTIONS 404
EXERCISES 407
DEBUGGING EXERCISES 410
GAME ZONE 410
TOUGH QUESTIONS 411
UP FOR DISCUSSION 412

CHAPTER 10 ADVANCED INHERITANCE CONCEPTS 413


CREATING AND USING ABSTRACT CLASSES 414
USING DYNAMIC METHOD BINDING 418
Using a Superclass as a Method Parameter Type 419
CREATING ARRAYS OF SUBCLASS OBJECTS 420
USING THE Object CLASS AND ITS METHODS 422
Using the toString() Method 423
Using the equals() Method 425
USING INHERITANCE TO ACHIEVE GOOD SOFTWARE DESIGN 428
CREATING AND USING INTERFACES 429
Creating Interfaces to Store Related Constants 434
CREATING AND USING PACKAGES 435
YOU DO IT 437
Creating an Abstract Class 437
Extending an Abstract Class 438
Extending an Abstract Class with a Second Subclass 440
Instantiating Objects from Subclasses 441
Using Object References 442
Overriding the Object Class equals() Method 444
Eliminating Duplicate User Entries 445
Creating a Package 446
DON’T DO IT 449
KEY TERMS 449

xii
CONTENTS

CHAPTER SUMMARY 450


REVIEW QUESTIONS 451
EXERCISES 454
DEBUGGING EXERCISES 457
GAME ZONE 458
TOUGH QUESTIONS 458
UP FOR DISCUSSION 458

CHAPTER 11 EXCEPTION HANDLING 461


LEARNING ABOUT EXCEPTIONS 462
TRYING CODE AND CATCHING Exceptions 467
THROWING AND CATCHING MULTIPLE Exceptions 471
USING THE Finally BLOCK 476
UNDERSTANDING THE ADVANTAGES OF EXCEPTION HANDLING 478
SPECIFYING THE Exceptions A METHOD CAN THROW 480
TRACING Exceptions THROUGH THE CALL STACK 486
CREATING YOUR OWN Exceptions 490
USING ASSERTIONS 493
YOU DO IT 498
Catching an Exception and Using getMessage() 498
Generating a NumberFormatException 500
Adding NumberFormatException Handling Capabilities
to an Application 500
Creating a Class That Automatically Throws Exceptions 501
Creating a Class That Passes on an Exception 502
Creating an Application That Can Catch Exceptions 504
Extending a Class That Throws Exceptions 506
Using the printStackTrace() Method 507
Creating an Exception Class 509
Using an Exception You Created 509
DON’T DO IT 513
KEY TERMS 513
CHAPTER SUMMARY 514
REVIEW QUESTIONS 515
EXERCISES 518
DEBUGGING EXERCISES 522
GAME ZONE 522
TOUGH QUESTIONS 523
UP FOR DISCUSSION 523

xiii
CONTENTS

CHAPTER 12 FILE INPUT AND OUTPUT 525


UNDERSTANDING COMPUTER FILES 526
USING THE File CLASS 527
UNDERSTANDING DATA FILE ORGANIZATION AND STREAMS 530
USING STREAMS 532
WRITING TO AND READING FROM A FILE 536
Reading from a File 538
WRITING FORMATTED FILE DATA 540
READING FORMATTED FILE DATA 543
USING A VARIABLE FILENAME 545
CREATING AND USING RANDOM ACCESS FILES 548
WRITING RECORDS TO A RANDOM ACCESS FILE 551
READING RECORDS FROM A RANDOM ACCESS FILE 556
Accessing a Random Access File Sequentially 556
Accessing a Random Access File Randomly 557
READING AND WRITING OBJECTS TO AND FROM FILES 559
YOU DO IT 563
Using the File Class to Examine File Status 563
Comparing Two File Dates 564
Using InputStream and OutputStream Objects 565
Writing to an Output File 568
Reading Data from a File 568
Creating a Class to Use in a File of Objects 569
Creating a Program that Writes Event Objects to a File 571
Creating a Program that Accesses Stored Event Object Data 572
DON’T DO IT 576
KEY TERMS 576
CHAPTER SUMMARY 578
REVIEW QUESTIONS 579
EXERCISES 581
DEBUGGING EXERCISES 584
GAME ZONE 584
TOUGH QUESTIONS 584
UP FOR DISCUSSION 585

CHAPTER 13 INTRODUCTION TO SWING COMPONENTS 587


UNDERSTANDING Swing COMPONENTS 588
USING THE JFrame CLASS 589
Customizing a JFrame’s Appearance 593

xiv
CONTENTS

USING A JLabel 594


Changing a JLabel’s Font 596
USING A LAYOUT MANAGER 598
EXTENDING THE JFrame CLASS 600
ADDING JTextFields, JBUTTONS, AND TOOL TIPS TO A JFrame 602
Adding JButtons 604
Using Tool Tips 606
LEARNING ABOUT EVENT-DRIVEN PROGRAMMING 607
Preparing Your Class to Accept Event Messages 607
Telling Your Class to Expect Events to Happen 608
Telling Your Class How to Respond to Events 608
Using the setEnabled() Method 611
UNDERSTANDING Swing EVENT LISTENERS 611
USING THE JCheckBox CLASS 614
USING THE ButtonGroup CLASS 618
USING THE JComboBox CLASS 619
YOU DO IT 621
Creating a JFrame 621
Ending an Application When a JFrame Closes 623
Adding Components to a JFrame 623
Adding Functionality to a JButton and a JTextField 625
Distinguishing Event Sources 626
Including JCheckBoxes in an Application 627
DON’T DO IT 630
KEY TERMS 631
CHAPTER SUMMARY 632
REVIEW QUESTIONS 634
EXERCISES 637
DEBUGGING EXERCISES 638
GAME ZONE 639
TOUGH QUESTIONS 640
UP FOR DISCUSSION 640

CHAPTER 14 ADVANCED GUI TOPICS 641


UNDERSTANDING THE CONTENT PANE 642
USING COLOR 647
LEARNING MORE ABOUT LAYOUT MANAGERS 648
Using BorderLayout 649
Using FlowLayout 651
Using GridLayout 653

xv
CONTENTS

Using CardLayout 655


Using Advanced Layout Managers 656
USING THE JPanel CLASS 657
CREATING JScrollPanes 664
A CLOSER LOOK AT EVENTS AND EVENT HANDLING 666
An Event-Handling Example: KeyListener 669
USING AWTEvent CLASS METHODS 671
Understanding x- and y-Coordinates 673
HANDLING MOUSE EVENTS 674
USING MENUS 680
Using JCheckBoxMenuItem and JRadioButtonMenuItem Objects 683
Using addSeparator() 684
Using setMnemonic() 685
YOU DO IT 686
Using BorderLayout 686
Using Fewer than Five Components with the BorderLayout Manager 687
Using FlowLayout 688
Using GridLayout 689
Using CardLayout 690
Viewing All the Cards in CardLayout 690
Using a Menu Bar and JPanels 691
DON’T DO IT 696
KEY TERMS 696
CHAPTER SUMMARY 698
REVIEW QUESTIONS 699
EXERCISES 702
DEBUGGING EXERCISES 703
GAME ZONE 704
TOUGH QUESTIONS 708
UP FOR DISCUSSION 708

CHAPTER 15 GRAPHICS 709


LEARNING ABOUT THE paint() AND repaint() METHODS 710
Using the setLocation() Method 712
USING THE drawString() METHOD 714
Using the setFont() and setColor() Methods 715
Using Color 716
CREATING Graphics AND Graphics2D OBJECTS 717

xvi
CONTENTS

DRAWING LINES AND SHAPES 718


Drawing Ovals 720
Drawing Arcs 721
Creating Shadowed Rectangles 722
Creating Polygons 723
Copying an Area 725
LEARNING MORE ABOUT FONTS AND METHODS YOU CAN USE WITH THEM 726
Discovering Screen Statistics Using the Toolkit Class 728
Discovering Font Statistics 729
DRAWING WITH JAVA 2D GRAPHICS 731
Specifying the Rendering Attributes 731
Setting a Drawing Stroke 733
Creating Objects to Draw 734
YOU DO IT 736
Using the drawString() Method 736
Using Fonts and Colors 737
Creating Your Own Graphics Object 738
Examining Screen Coordinates 739
Creating a Drawing 740
Copying an Area 741
Using FontMetrics Methods to Compare Fonts 742
Using FontMetrics Methods to Place a Border Around a String 745
Using Drawing Strokes 746
Working with Shapes 748
DON’T DO IT 749
KEY TERMS 749
CHAPTER SUMMARY 751
REVIEW QUESTIONS 752
EXERCISES 755
DEBUGGING EXERCISES 758
GAME ZONE 758
TOUGH QUESTIONS 761
UP FOR DISCUSSION 761

CHAPTER 16 APPLETS, IMAGES, AND SOUND 763


INTRODUCING APPLETS 764
Understanding the JApplet Class 765
Running an Applet 765
WRITING AN HTML DOCUMENT TO HOST AN APPLET 766
CREATING A JApplet THAT CONTAINS AN init() METHOD 768

xvii
CONTENTS

WORKING WITH JApplet COMPONENTS 770


UNDERSTANDING THE JApplet LIFE CYCLE 772
The init() Method 773
The start() Method 773
The stop() Method 773
The destroy() Method 774
UNDERSTANDING MULTIMEDIA AND USING IMAGES 774
Adding Images to JApplets 775
Using ImageIcons 777
ADDING SOUND TO JApplets 780
YOU DO IT 781
Creating an HTML Document to Host an Applet 781
Creating and Running a JApplet 782
Running a JApplet in Your Web Browser 783
Creating a More Complicated JApplet 783
Making the JApplet’s Button Respond to Events 785
Understanding the Applet Life Cycle 786
Displaying Images 790
Playing Sounds 791
DON’T DO IT 793
KEY TERMS 793
CHAPTER SUMMARY 794
REVIEW QUESTIONS 795
EXERCISES 798
DEBUGGING EXERCISES 800
GAME ZONE 801
TOUGH QUESTIONS 805
UP FOR DISCUSSION 805

APPENDIX A WORKING WITH THE JAVA PLATFORM 807


APPENDIX B LEARNING ABOUT ASCII AND UNICODE 815
APPENDIX C FORMATTING OUTPUT 821
APPENDIX D GENERATING RANDOM NUMBERS 833
APPENDIX E JAVADOC 839
GLOSSARY 847
INDEX 867

xviii
PREFACE
Java Programming, Fifth Edition provides the beginning programmer with a guide to developing applica-
tions using the Java programming language. Java is popular among professional programmers because it
can be used to build visually interesting graphical user interface (GUI) and Web-based applications. Java
also provides an excellent environment for the beginning programmer—a student quickly can build use-
ful programs while learning the basics of structured and object-oriented programming techniques.
This textbook assumes that you have little or no programming experience. This book provides a solid
background in good object-oriented programming techniques and introduces object-oriented terminology
using clear, familiar language. The writing is nontechnical and emphasizes good programming practices.
The examples are business examples; they do not assume a mathematical background beyond high-school
business math. In addition, the examples illustrate only one or two major points; they do not contain so
many features that you become lost following irrelevant and extraneous details. The explanations in this
textbook are written clearly in straightforward sentences so that native and non-native English speakers
alike can master the programming concepts. Complete, working code examples appear frequently in each
chapter; these examples help the student make the transition from the theoretical to the practical. The
code presented in each chapter is also provided on disk, so that students can easily run the programs and
experiment with changes to them.

ORGANIZATION AND COVERAGE


Java Programming, Fifth Edition presents Java programming concepts, enforcing good style, logical
thinking, and the object-oriented paradigm. Objects are covered right from the beginning, earlier than in
many other textbooks. You create your first Java program in Chapter 1. Chapters 2, 3, and 4 increase your
understanding of how data, classes, objects, and methods interact in an object-oriented environment.
Chapters 5 and 6 explore input and repetition structures, which are the backbone of programming logic
and essential to creating useful programs in any language. You learn the special considerations of string
and array manipulation in Chapters 7 and 8.
Chapters 9, 10, and 11 thoroughly cover inheritance (the object-oriented concept that allows you
to develop new objects quickly by adapting the features of existing ones) and exception handling
(the object-oriented approach to handling errors). Both are important concepts in object-oriented
design. Chapter 12 provides information on handling files so you can permanently store and retrieve
program output.
Chapters 13 and 14 introduce GUI Swing components—Java’s visually pleasing, user-friendly widgets—and
their layout managers. Chapters 15 and 16 show you ways to provide interactive excitement using graphics,
applets, images, and sound.
In every chapter, Java Programming, Fifth Edition follows the text explanation with a “You Do It” section
that contains step-by-step exercises to illustrate the concepts just learned, reinforcing the student’s under-
standing and allowing concepts to be better retained. Creating the programs in the step-by-step examples

xix
PREFACE

also provides students with a successful experience in the language; finishing the examples provides them
with models for their own creations.
The student using Java Programming, Fifth Edition builds applications from the bottom up, rather than
starting with existing objects. This facilitates a deeper understanding of the concepts used in object-
oriented programming, and engenders appreciation for the existing objects students use as their knowl-
edge of the language advances. When students complete this book, they will know how to modify and
create simple Java programs and will have the tools to create more complex examples. They also will
have a fundamental knowledge of object-oriented programming, which will serve them well in advanced
Java courses or in studying other object-oriented languages such as C++, C#, and Visual Basic.

FEATURES
Java Programming, Fifth Edition is a superior textbook because it also includes the following features:
» Objectives: Each chapter begins with a list of objectives so you know the topics that will be present-
ed in the chapter. In addition to providing a quick reference to topics covered, this feature provides a
useful study aid.
» Notes: These highlighted tips provide additional information—for example, an alternative method
of performing a procedure, another term for a concept, background information on a technique, or a
common error to avoid.
» Figures: Each chapter contains many figures. Code figures are most frequently 25 lines or less, illus-
trating one concept at a time. Frequently placed screen shots show exactly how program output
appears.
NEW! » Callouts in more figures: Callouts have been added to many figures to help students focus on the
points emphasized in the text. Some icons contain the words “Don’t Do It” to emphasize when an
example illustrates a practice not to emulate.
» Color: The code figures in each chapter contain all Java keywords in brown. This helps students
identify keywords more easily, distinguishing them from programmer-selected names.
» Files: The Student Disk holds more than 180 files that contain the code presented in the figures in
each chapter. Students can run the code for themselves, view the output, and make changes to the
code to observe the effects.
NEW! » Two Truths and a Lie: A new quiz reviews each chapter section, with answers provided. This quiz
contains three statements from the preceding section of text—two statements are true and one is
false. Over the years, students have requested answers to problems, but we have hesitated to distrib-
ute them in case instructors want to use problems as assignments or test questions. These true-false
mini-quizzes provide students with immediate feedback as they read, without “giving away”
answers to the existing multiple-choice and programming problem questions.
» You Do It: In each chapter, step-by-step exercises help the student create multiple working pro-
grams that emphasize the logic a programmer uses in choosing statements to include. This section
provides a means for students to achieve success on their own—even those in online or distance
learning classes.
NEW! » Don’t Do It: This section at the end of each chapter summarizes common mistakes and pitfalls that
plague new programmers while learning the current topic.

xx
PREFACE

» Key Terms: Each chapter includes a list of newly introduced vocabulary, shown in the order of appear-
ance in the text. The list of key terms provides a mini-review of the major concepts in the chapter.
» Summaries: Following each chapter is a summary that recaps the programming concepts and tech-
niques covered in the chapter. This feature helps students check their understanding of the main
points in each chapter.
» Review Questions: Each chapter includes 20 multiple-choice questions that serve as a review of
chapter topics.
» Exercises: Each chapter concludes with meaningful programming exercises that provide additional
practice of the skills and concepts learned in the chapter. These exercises vary in difficulty and are
designed to allow exploration of logical programming concepts.
» Game Zone: Each chapter provides one or more exercises in which the student creates interactive
games using the programming techniques learned up to that point; 70 game programs are suggested
in the book. The games are fun to create and play; writing them motivates students to master the
necessary programming techniques. Students might exchange completed game programs with each
other, suggesting improvements and discovering alternate ways to accomplish tasks.
» Tough Questions: Each chapter includes two or more fairly difficult, and often open-ended, questions NEW!
that are typical of what an applicant might encounter in a technical job interview. Some questions involve
coding; others might involve research.
» Up for Discussion: Each chapter concludes with a few thought-provoking questions concerning
programming in general or Java in particular. The questions can be used to start classroom or online
discussions, or to develop and encourage research, writing, and language skills.
» Glossary: This edition includes a glossary that contains definitions for all key terms in the book, NEW!
presented in alphabetical order.
» Appendix on javadoc: This edition includes a new appendix on creating javadoc comments. NEW!
» Other pedagogical improvements: This edition introduces the following pedagogical improvements: NEW!
» The Scanner class is introduced in Chapter 2 to facilitate user keyboard entry in programs.
» Programming examples provide earlier and more consistent use of named constants.
» Clearer distinction between troublesome concepts is provided—for example, argument vs. parameter
and static vs. nonstatic.
» The String chapter focuses on StringBuilder instead of StringBuffer because StringBuilder
is more efficient. However, it is emphasized that the two classes are used in exactly the same way.
» The GUI chapters have been completely rewritten and moved later in the book, which makes it
easier for instructors who want to cover the concepts of inheritance and polymorphism first. Similarly,
applet coverage has been removed from the GUI chapters, which makes it easier for instructors who
want to cover GUI topics first.
» Applets have been moved to the last chapter in the book, reflecting their diminished popularity as
a business tool.
» Quality: Every program example in the book, as well as every exercise and game solution, was
tested by the author and then tested again by a Quality Assurance team using Java Standard
Edition (SE) 6, the most recent version available. (The external version number used by Sun
Microsystems is 6.0; the internal version number is 1.6.0. For more information on the features
of the JDK, visit http://java.sun.com.)

xxi
PREFACE

» CD-ROM included with book: The CD that comes with this book includes the following items:
» Sun Microsystems Java SE 6, the Java language, compiler, and runtime environment
» The jGRASP integrated development environment for Java
» Code files for all Java program examples contained in the text

TEACHING TOOLS
The following supplemental materials are available when this book is used in a classroom setting. All of
the teaching tools available with this book are provided to the instructor on a single CD.
» Electronic Instructor’s Manual: The Instructor’s Manual that accompanies this textbook includes
additional instructional material to assist in class preparation, including items such as Sample Syllabi,
Chapter Outlines, Technical Notes, Lecture Notes, Quick Quizzes, Teaching Tips, Discussion Topics,
and Key Terms.
» ExamView®: This textbook is accompanied by ExamView, a powerful testing software package
that allows instructors to create and administer printed, computer (LAN-based), and Internet-
based exams. ExamView includes hundreds of questions that correspond to the topics covered in
this text, enabling students to generate detailed study guides that include page references for further
review. The computer-based and Internet testing components allow students to take exams at their
computers, and they save the instructor time by grading each exam automatically.
» PowerPoint Presentations: This book comes with Microsoft PowerPoint slides for each chapter.
These are included as a teaching aid for classroom presentation, to make available to students on the
network for chapter review, or to be printed for classroom distribution. Instructors can add their
own slides for additional topics they introduce to the class.
» Solution Files: Solutions to “You Do It” exercises and all end-of-chapter exercises are provided
on the Instructor Resources CD and on the Course Technology Web site at www.course.com. The
solutions are password protected.
Annotated solutions are provided for the multiple-choice Review Questions. For example, if students
are likely to debate answer choices, or not understand the choice deemed to be the correct one,
a rationale is provided.
» Distance Learning: Course Technology is proud to present online test banks in WebCT and
Blackboard to provide the most complete and dynamic learning experience possible. Instructors
are encouraged to make the most of the course, both online and offline. For more information on
how to access the online test bank, contact your local Course Technology sales representative.

xxii
PREFACE

ACKNOWLEDGEMENTS
I would like to thank all of the people who helped to make this book a reality, especially Dan Seiter,
Development Editor. Dan’s suggestions and attention to detail made this a superior book, and his sense
of humor made writing it practically painless.
Thanks also to Tricia Coia, Managing Editor; and Heather Furrow, Content Project Manager. I am lucky
to work with Tricia and Heather; they are dedicated to producing quality instructional materials.
Thanks to Serge Palladino, John Freitas, and Chris Scriver of the Quality Assurance Department.
Thank you to Dick Grant of Seminole Community College, Sanford, Florida. He provided important
technical and pedagogical suggestions based on his classroom use of this book. He possesses the rare
combination of excellent teacher and programmer, and he made this book more accurate and more
useful to students.
I am also grateful to the many other reviewers who provided comments and encouragement during this
book’s development, including Karlyn Barilovits, Kaplan University; Kay Chen, Bucks County Community
College; Roman Erenshteyn, Goldey-Beacom College; Jeff Hedrington, University of Phoenix-Online; and
Aaron Jagers, Louisiana Technical College.
Thanks, too, to my husband, Geoff, who supports me every step of the way. Finally, this book is dedicated
to our lifelong friends, George and Mary Profeta.
Joyce Farrell

xxiii
This page intentionally left blank
Another Random Scribd Document
with Unrelated Content
CHAPTER XIX

C
lementina went to bed a happier woman than she had been for
many a day. Distrusting the ministrations of the Chinese nurse,
she had set up a little bed for Sheila in her own room. The
child lay there fast asleep, the faithful Pinkie projecting from a folded
arm in a staring and uncomfortable attitude of vigilance.
Clementina’s heart throbbed as she bent over her. All that she had
struggled for and had attained, mastery of her art, fame and
fortune, shrank to triviality in comparison with this glorious gift of
heaven. She remembered scornful words she had once spoken to
Tommy: “Woman has always her sex hanging round the neck of her
spirit.” She recognised the truth of the saying and thanked God for
it. She undressed very quietly and walked about the room in
stocking-feet, feeling a strange sacredness in the presence of the
sleeping child.
She was happier, too, in that she had forgiven Quixtus; for the
first time since she had known him she felt a curiosity regarding him,
a desire for his friendship; scarcely formulated, arose a
determination to bring something vital into his life. As the notable
housewife entering a forlorn man’s neglected house longs to throw
open windows, shake carpets, sweep down cobwebs, abolish dingy
curtains, and fill the place with sunlight and chintz and other gaiety,
so did Clementina long to sweep and garnish Quixtus’s dusty heart.
He had many human possibilities. After all, there must be something
sound in a man who had treasured in his mind the memory of her
picture. Sheila and herself, between them, would transform him into
a gaunt angel. She fell asleep smiling at the thought.
Clementina did not suffer fools gladly. That was why, thinking
Quixtus a fool, she had not been able to abide him for so many
years. And that was why she could not abide the fat Chinese nurse,
who showed herself to be a mass of smiling incompetence. “The way
she washes the child makes me sick,” she declared. “If I see much
more of her heathen idol’s grin, I’ll go mad and bite her.” So the next
day Clementina, with Quixtus as a decorative adjunct, hunted up
consular and other authorities and made with them the necessary
arrangements for shipping her off to Shanghai, for which she
secretly pined, by the next outward-bound steamer. When they got
to London she would provide the child with a proper Christian nurse,
who would bring her up in the fear of the Lord and in habits of
tidiness; and in the meanwhile she herself would assume the
responsibility of Sheila’s physical well-being.
“I’m not going to have a flighty young girl,” she remarked. “I
could tackle her, but you couldn’t.”
“Why should I attempt to tackle her?” asked Quixtus.
“You’ll be responsible for the child when she stays in Russell
Square.”
“Russell Square?” he echoed.
“Yes. She will live partly with you and partly with me—three
months with each of us, alternately. Where did you expect the child
to live?”
“Upon my soul,” said he, “I haven’t considered the matter. Well—
well——”
He walked about the vestibule, revolving this new and alarming
proposition. To have a little girl of five planted in his dismal,
decorous house—what in the world should he do with her? It would
revolutionise his habits. Clementina watched him out of a corner of
her eye.
“You didn’t suppose I was going to have all the worry, did you?”
“No, no,” he said hastily. “Of course not. I see I must share all
responsibilities with you. Only—won’t she find living with me rather
dull?”
“You can keep a lot of cats and dogs and rocking-horses, and
give children’s parties,” said Clementina.
Sheila, who had been apparently absorbed in the mysteries of
the Parisian toilet of a flaxen-haired doll which Clementina had
bought for her at an extravagant price, cheerfully lifted up her face.
“Auntie says that when I come to stay with you, I’m to be
mistress of the house.”
“Indeed?” said Quixtus.
“And I’m to be a real lady and sit at the end of the table and
entertain the guests.”
“I suppose that settles it?” he said, with a smile.
“Of course it does,” said Clementina, and she wondered whether
his masculine mind would ever be in a condition to grasp the extent
of the sacrifice she was making.
That day the remains of Will Hammersley were laid to rest in the
little Protestant cemetery. The consular chaplain read the service.
Only the two elders stood by the graveside, thinking the ordeal too
harrowing for the child. Clementina wept, for some of her wasted
youth lay in the coffin. But Quixtus stood with dry eyes and set
features. Now he was sane. Now he could view life calmly. He knew
that his memory of the dead would always be bitter. Reason could
not sweeten it. It were better to forget. Let the dead past bury its
dead. The dead man’s child he would take to his heart for her own
helpless, sweet sake. Should she, in years to come, turn round and
repay him with treachery and ingratitude, it would be but the way of
all flesh. In the meanwhile he would be loyal to his word.
After the service came to a close he stood for a few moments
gazing into the grave. Clementina edged close to him and pointed
down to the coffin.
“He may have wronged you, but he trusted you,” she said in a
low voice.
“That’s true,” said Quixtus. And as they drove back in silence, he
murmured once or twice to himself, half audibly:
“He wronged me, but he trusted me.”
That evening they started for Paris.
Undesirous of demonstrative welcome at half-past eight in the
morning, Clementina had not informed Tommy and Etta of the time
of her arrival, and Quixtus had not indulged in superfluous
correspondence with Huckaby. The odd trio now so closely related
stood lonely at the exit of the Lyons Station, while porters deposited
their luggage in cabs. Each of the elders felt a curious reluctance to
part—even for a few hours, for they had agreed to lunch together.
Sheila shed a surprised tear. She had adjusted her small mind to the
entrance of her Uncle Ephraim into her life. The sudden exit startled
her. On his promising to see her very soon, she put her arms prettily
round his neck and kissed him. He drove off feeling the flower-like
pressure of the child’s lips to his, and it was very sweet.
It helped him to take up the threads of Paris where he had left
them, a difficult task. Deep shame smote him. What could be
henceforward his relations with Huckaby whom, with crazy,
malevolent intent, he had promised to maintain in the path of clean
living? With what self-respect could he look into the eyes of Mrs.
Fontaine, innocent and irreproachable woman, whose friendship he
had cultivated with such dastardly design? She had placed herself so
frankly, so unsuspectingly in his hands. To him, now, it was as
unimaginable to betray her trust as to betray that of the child whose
kiss lingered on his lips. If ever a woman deserved compensation,
full and plenteous, at the hands of man, that was the woman. An
insult unrealised is none the less an insult; and he, Quixtus, had
insulted a woman. If only to cleanse his own honour from the stain,
he must make compensation to this sweet lady. But how? By faithful
and loyal service.
When he solemnly reached this decision I think that more than
one angel wept and at the same time wanted to shake him.
And behind these two whom he would meet in Paris, loomed the
forbidding faces of Billiter and Vandermeer. He shivered as at contact
with something unclean. He had chosen these men as ministers of
evil. He had taken them into his crazy confidence. With their tongues
in their cheeks, these rogues had exploited him. He remembered
loathsome scenarios of evil dramas they had submitted. Thank
Heaven for the pedantic fastidiousness that had rejected them!
Billiter, Vandermeer, Huckaby—the only three of all men living who
knew the miserable secret of his recent life! In a rocky wilderness he
could have raced with wild gestures like the leper, shouting
“Unclean! Unclean!” But Paris is not a rocky wilderness, and the
semi-extinct quadruped in the shafts of the modern Paris fiacre
conveys no idea of racing.
Yet while his soul cried this word of horror, the child’s kiss
lingered as a sign and a consecration.
The first thing to do was to set himself right with Huckaby.
Companionship with the man on the recent basis was impossible. He
made known his arrival, and an hour afterwards, having bathed and
breakfasted, he sat with Huckaby in the pleasant courtyard of the
hotel. Huckaby, neat and trim and clear-eyed, clad in well-fitting blue
serge, gave him the news of the party. Mrs. Fontaine had introduced
him to some charming French people whose hospitality he had
ventured to accept. She was well and full of plans for little festas for
the remainder of their stay in Paris. Lady Louisa had found a cavalier,
an elderly French marquis of deep gastronomic knowledge.
“Lady Louisa,” said he with a sigh of relief and a sly glance at
Quixtus, “is a charming lady, but not a highly intellectual
companion.”
“Do you really crave highly intellectual companions, Huckaby?”
asked Quixtus.
Huckaby bit his lip.
“Do you remember our last conversation?” he said at last.
“I remember,” said Quixtus.
“I asked you for a chance. You promised. I was in earnest.”
“I wasn’t,” said Quixtus.
Huckaby started and gripped the arm of his chair. He was about
to protest when Quixtus checked him.
“I want you to know,” said he, “that great changes have taken
place since then. I left Paris in ill-health, I return sound. I should like
you to grasp the deep significance underlying those few words. I will
repeat them.”
He did so. Huckaby looked hard at his patron, who stood the
scrutiny with a grave smile.
“I think I understand,” he replied slowly. “Then Billiter and
Vandermeer?”
“Billiter and Vandermeer I put out of my life for ever; but I shall
see they are kept from want.”
“They can’t be kept from wanting more than you give them,” said
Huckaby, whose brain worked swiftly and foresaw blackmail. “You
must impose conditions.”
“I never thought of that,” said Quixtus.
“Set a thief to catch a thief,” said the other bitterly; “I’m telling
you for your own good.”
“If they attempt to write to me or see me, their allowances will
cease.”
He covered his eyes with his hand, as though to shut out their
hateful faces. There was a short silence. Huckaby’s lips grew dry. He
moistened them with his tongue.
“And what about me?” he asked at last.
Quixtus drew away his hand with a despairing gesture, but made
no reply.
“I suppose you’re right in classing me with the others,” said
Huckaby. “Heaven knows I oughtn’t to judge them. I was in with
them all the time”—Quixtus winced—“but I can’t go back to them.”
“My treating you just the same as them won’t necessitate your
going back to them.”
Huckaby bent forward, quivering, in his chair. “As there’s a God in
Heaven, Quixtus, I wouldn’t accept a penny from you on those
terms.”
“And why not?”
“Because I don’t want your money. I want to be put in a position
to earn some honourably for myself. I want your help as a man, your
sympathy as a human being. I want you to help me to live a clean,
straight life. I kept the promise, the important promise I made you,
ever since we started. You can’t say I haven’t. And since you left I’ve
not touched a drop of alcohol—and, if you promise to help me, I
swear to God I never will as long as I live. What can I do, man,” he
cried, throwing out his arms, “to prove to you that I’m in deadly
earnest?”
Quixtus lay back in his chair reflecting, his finger-tips joined
together. Presently a smile, half humorous, half kindly, lit up his
features—a smile such as Huckaby had not seen since before the
days of the hostless dinner of disaster, and it was manifest to
Huckaby that some at least of the Quixtus of old had come back to
earth.
“In the last day or two,” said Quixtus, “I have formed a staunch
friendship with one who was a crabbed and inveterate enemy. It is
Miss Clementina Wing, the painter, whom you saw, in somewhat
painful circumstances, the other day at the tea-room. I will give you
an opportunity—I hope many—of meeting her again. I don’t want to
hurt your feelings, my dear Huckaby—but so many strange things
have happened of late, that I, for the present, mistrust my own
judgment. I hope you understand.”
“Not quite. You don’t mean to tell——”
Quixtus flushed and drew himself up.
“After twenty years, do you know me so little as that?”
“I beg your pardon,” said the other humbly.
Again Quixtus smiled, at a reminiscent phrase of Clementina’s.
“At any rate, my dear fellow,” said he, “even if she doesn’t
approve of you, she will do you a thundering lot of good.”
At the smile Huckaby took heart of grace; but at the same time
the memory of Clementina, storming over the tea-table, for all the
world like a French revolutionary general, filled his soul with
wholesome dismay. Well, there was no help for it; he must take his
chance; so he filled a philosophic pipe.
A little later Quixtus met the spotless flower of womanhood
whom he had so grievously insulted. She greeted him with both
hands outstretched. Without him Paris had been a desert. Why had
he not sent her the smallest, tiniest line of news? Ah! she
understood. It had been a sojourn of pain. Never mind. Paris, she
hoped, would prove to be an anodyne. Only if she would administer
it in the right doses; said Quixtus gallantly. Dressed with exquisite
demureness, she found favour in his sight. He realised with a throb
of thanksgiving that henceforward he could meet her on equal terms
—as an honourable gentleman—no grotesque devilry haunting the
back of his mind and clouding the serenity of their intercourse.
“Tell me what you have been doing with yourself,” she said,
drawing him to a seat. The little air of intimacy and ownership so
delicately assumed, captivated the remorseful man. He had not
realised the charm that awaited him in Paris.
He touched lightly on Marseilles happenings, spoke of his
guardianship, of Sheila, of her clinging, feminine ways, drew a
smiling picture of his terror when Clementina had first left him alone
with the child.
Mrs. Fontaine laughed sympathetically at the tale, and then, with
a touch of tenderness in her voice that perhaps was not deliberate,
said:
“In spite of the worries, you have benefited by the change. You
have come back a different man.”
“In what way?”
“I can’t define it.”
“Try.”
A quick glance met earnest questioning in his eyes. She looked
down and daintily plucked at the sunshade across her lap.
“I should say you had come back more human.”
Quixtus’s eyelids flickered. Clementina had used the same word.
Was there then an obvious transformation from Quixtus furens to
Quixtus sane?
He remembered the child’s kiss. “Perhaps it’s my new
responsibilities,” he said with a smile.
“I should so much like to see her. I wonder if I ever shall,” said
Mrs. Fontaine.
“She is coming here to lunch with Miss Wing,” replied Quixtus,
eager now that his good friends should know and appreciate each
other. “Won’t Lady Louisa and yourself join us?”
“Delighted,” said Mrs. Fontaine. “Miss Clementina Wing is quite a
character. I should like to see more of her.”
Quixtus, his mind full of sweet atonement, did not detect any
trace of acidity in her words.
On the stroke of one, the time appointed for luncheon,
Clementina and Sheila appeared at the end of the long lounge,
Tommy and Etta straggling in their wake. Quixtus rose from the
table where his three friends were seated, and advanced to meet
them. Sheila ran forward and he took her in his arms and kissed her.
“You didn’t ask these children to lunch, but I brought ’em.”
“They’re very welcome,” said Quixtus, smiling.
Tommy, his fair face aflame with joy, wrung his hand. “I told you
I would look you up in the Hôtel Continental. By Jove! I am glad to
see you. I’ve been an awful ass, you know. Of course I thought——”
“Hush! Hush!” said Quixtus. “My dear Miss Concannon, I am
delighted to see you.”
“She goes by the name of Etta,” said Tommy, proudly.
Clementina jerked her thumb towards them:
“Engaged. Young idiots!”
“My dear Miss Etta,” said Quixtus, taking the hand of the furiously
blushing girl—“My friend, Tommy, is an uncommonly lucky fellow.”
He nodded at Sheila, who hung on to his finger-tips. “Have you
made friends with this young lady?”
“She’s a darling!” cried Etta.
“Clementina,” said Tommy, “you’re a wretch. You shouldn’t have
given us away.”
“You gave yourselves away, you silly geese. People have been
grinning at you all the time you were walking here.” Then her glance
fell upon the expectant trio a little way off. “Oh Lord!” she said,
“those people again!”
“They’re my very good friends,” said Quixtus, “and I want you to
meet them again in normal circumstances. I want you to like them.”
He looked at her in mild appeal. Clementina’s lips twisted into a
wry smile.
“All right,” she said. “Don’t worry. I’ll be civil.”
So it came to pass that the two women again faced each other;
Mrs. Fontaine all daintiness and fragrance in her simple but
exquisitely cut fawn costume, the chaste contours of her face set off
by an equally simple ten-guinea black hat with an ostrich feather;
Clementina, rugged, powerful, untidy in her ill-fitting mustardy
brown stuff skirt and jacket, and heavy, businesslike shoes; and
again between the two pairs of eyes was the flicker of rapiers. And
as soon as they were disengaged and Clementina turned to Lady
Louisa, she felt the other’s swift glance travel from the soles of her
feet to the rickety old rose in her hat. There are moments when sex
gives a woman eyes in the back of her head. She turned round
quickly and surprised the most elusive ghost of a smile imaginable.
For the first time in her life Clementina felt herself at a disadvantage.
She winced; then mentally, so as to speak, snapped her fingers.
What had she to do with the woman, or the woman with her?
All the presentations having been made, Quixtus led the way to
the restaurant of the hotel.
“Clementina,” said he, “may I ask you to concede the place of
honour for this occasion to my unexpected but most charming and
most welcome guest?”
He indicated Etta still blushing into whose ear Tommy whispered
that his uncle always spoke like a penny book with the covers off.
“My dear man,” said Clementina, “stick me anywhere, so long as
it’s next the baby and I can see that nobody feeds her on anchovies
and lobster salad.”
She understood perfectly. The second seat of honour was Mrs.
Fontaine’s. She confounded Mrs. Fontaine. But what was Mrs.
Fontaine to her or she to Mrs. Fontaine?
They took their places at the round table laid for eight. On
Quixtus’s right, Etta; on his left, Mrs. Fontaine; then Sheila,
somewhat awed at the grown-up luncheon party and squeezing
Pinkie very tight so as to give her courage; then Clementina with
Huckaby as left-hand neighbour; then Lady Louisa, and Tommy next
to Etta.
Clementina kept her word and behaved with great civility. Tommy
politely addressed Lady Louisa to the immense relief of Huckaby,
who thus temporarily freed from his Martha, plunged into eager
conversation with Clementina about her picture in the Salon, which
had attracted considerable attention. He did not tell her that, in
order to refresh his memory of the masterpiece, he had revisited the
Grand Palais that morning. He praised the technique. There was in it
that hint of Velasquez which so many portrait-painters tried for and
so few got. This pleased Clementina. Velasquez was the god of her
art. One bright space in her dreary youth was her life with Velasquez
in Madrid.
“I too once tried to know something about him,” said Huckaby. “I
wrote a monograph—a wretched compilation only—in a series of
Lives of Great Painters for a firm of publishers.”
Hack work or not, the authorship of a Life of Velasquez was
enough to prejudice her in Huckaby’s favour. She learned, too, that
he was a sometime Fellow of Corpus Christi College, Cambridge, and
a university contemporary of Quixtus. Huckaby, finding her not the
rough-tongued virago from whom Quixtus had always shrunk, and of
whom, at their one meeting in the tea-room, he, himself, had not
received the suavest impression, but a frank, intelligent woman,
gradually forgot his anxiety to please and talked naturally as became
a man of his scholarship. The result was that Clementina thought
him a pleasant and sensible fellow, an opinion which she expressed
later in the day to Quixtus.
With regard to Mrs. Fontaine, her promise of ladylike behaviour
was harder to keep. All through the meal her dislike grew stronger.
That Quixtus should bend towards Etta, in his courtly fashion, and
pay her little gallant attentions, was but natural; indeed it was
charming courtesy towards Tommy’s betrothed; but that he should
do the same to Mrs. Fontaine and add to it a subtle shade of
intimacy, was exasperating. In the lady’s attitude, too, towards
Quixtus, Clementina perceived an air of proprietorship, a triumphant
consciousness of her powers of fascination. When Quixtus addressed
a remark across the table to Clementina, Mrs. Fontaine adroitly drew
his attention to herself. Her manner gave Clementina to understand
that, although a frump of a portrait painter might be an important
person in a studio, yet in the big world outside, the attractive woman
had victorious pre-eminence. Now Clementina was a woman, and
one whose nature had lately gone through unusual convulsions. She
found it difficult to be polite to Mrs. Fontaine. Only once was there a
tiny eruption of the volcano.
Sheila’s seat at the table being too low for her small body,
Clementina demanded a cushion from the maître d’hôtel. When,
after some delay, a waiter brought it, she was engaged in talk with
Huckaby. She turned in time to see Mrs. Fontaine about to lift Sheila
from her seat. With a sudden, rough movement she all but snatched
the child out of the other’s arms, and herself saw to Sheila’s
sedentary comfort.
She didn’t care what Quixtus or any one else thought of her. She
was not going to have this alien woman touch her child. The hussy
flirtation with Quixtus she could not prevent. But no woman born of
woman should come between her and the beloved child of her
adoption.
The incident passed almost unnoticed. The meal ended
pleasantly. With the exception of the two women in their mutual
attitude, everybody was surprisedly delighted with everybody else.
Etta thought Quixtus the very dearest thing, next to Admiral
Concannon, that had ever a bald spot on the top of his head.
Clementina, in a fit of graciousness, gave Huckaby the precious
freedom of her studio. He could come and look at her pictures
whenever he liked. Sheila, made much of, went away duly impressed
with her new friends. Quixtus rubbed his hands at the success of his
party. The apparently irreconcilable were reconciled, difficulties were
vanishing rapidly, his path stretched out before him in rosy
smoothness.
But Tommy’s quick eyes had noticed the snatching of Sheila.
“Etta,” said he, “I’ve known Clementina intimately all these years,
and I find I know nothing at all about her.”
“What do you mean?” asked the girl.
“For the first time in my life,” said he, “I’ve just discovered that
the dear old thing is as jealous as a cat.”
CHAPTER XX

M
y good children, I tell you we’ll go by train,” said Clementina,
putting her foot down. “I don’t care a brass button for the
chauffeur’s loneliness, and the prospect of his pining away on
his journey back to London leaves me cold.”
She had exhausted the delights of the car of thirty-five million
dove-power, and was anxious to settle Sheila in Romney Place as
quickly as possible.
“As for you two,” she added, “you have had as big a dose of each
other as is good for you.”
Only one thing tempted her to linger in Paris—curiosity as to the
sentimental degree of the friendship between the lady of her
disfavour and Quixtus. That she was a new friend and not an old
friend, the exchange of a few remarks with the ingenuous Lady
Louisa had enabled her very soon to discover. Clementina looked
askance on such violent intimacies. Quixtus, for whose welfare now
she felt herself, in an absurd way, responsible, had not the
constitution to stand them. The lady might be highly connected and
move in the selectest of circles, but she had a hard edge, betraying
what Clementina was pleased to call the society hack; she was
shallow, insincere; talked out of a hastily stuffed memory instead of
an intellect; she had the vulgarity of good breeding, as noticeable a
quality as the good-breeding of one in lowly station; she was
insufferable—an impossible companion for a man of Quixtus’s mental
equipment and sensitive organisation. There was something else
about her that baffled Clementina, and further whetted her curiosity.
Neither was Clementina perfect, nor did she look for perfection in
this compromise of a world. As an artist she demanded light and
shade. “I wouldn’t paint an angel’s portrait,” she said once, “for fifty
thousand pounds. And if an angel came to tea with me, the first
thing I should do would be to claw off his wings.” Now, no one could
deny the light and shade in Lena Fontaine. But there is such a thing
as false chiaroscuro, and it offends and perplexes the artist. Lena
Fontaine offended and perplexed Clementina.
Again, Clementina, with regard to the chambers of her heart, was
somewhat house-proud. Very few were admitted; but once admitted,
the favoured mortal was welcome to stay there for ever. Now,
behold an exasperating aggravation. She had just received Quixtus
in the very best guest-room, and, instead of admiring it and taking
his ease in it, here he was hanging halfway out of window, all ears
to a common hussy. If she had an insane desire to pull him back by
the coat-tails, who can blame her?
No sensible purpose being attainable, however, by lingering in
Paris, she gruffly sent temptation packing, and, with her brood
under her wing, took the noon train from the Gare du Nord on the
following day.
Quixtus was there, at the station, to see them off, his arms filled
with packages. As he could not raise his hat when the party
approached, he smiled apologetically, looking, according to Tommy,
like Father Christmas detected at Midsummer. There was a great
bouquet of orchids for Clementina (such a handy, useful thing on the
journey from Paris to London!) an enormous bonbonnière of sweets
for Etta; a stupendous woolly lamb for Sheila which, on something
being done to its anatomy, opened its mouth and gramaphonically
chanted the “Jewel Song” from Faust; and a gold watch for Tommy.
The singing of the lamb, incautiously exploited on the platform,
to Sheila’s ecstasy, caused considerable dislocation of railway
business. A crowd collected to see the gaunt, scholarly Englishman
holding the apocalyptic beast in his arms, all intent on the rapture of
the tiny flower-like thing standing open-mouthed before him. Even
porters forgot to say “Faites attention,” and stopped their barrows,
to listen to the magic song and view the unprecedented spectacle. It
was only when the lamb bleated his last note that Quixtus became
conscious of his surroundings.
“Good heavens!” said he.
“Do it again,” said Sheila, in her clear contralto, whereat the
bystanders laughed.
“Not for anything in the world, my dear. Tommy, take the infernal
thing. My dear,” said he, lifting Sheila in his arms, “if I know anything
of Tommy, he will have that tune going for the next seven hours.”
She allowed herself to be carried in seraphic content to the
entrance of the car in which was the compartment reserved for the
party. Tommy carrying the lamb, Clementina and Etta followed.
“That kid’s a wonder,” said Tommy. “She would creep into the
heart of a parsnip.”
Clementina, to whom the remark was addressed, walked three or
four steps in silence. Then she said:
“Tommy, if I hear you say a thing like that again, I’ll box your
ears.”
He stared at her in amazement. He had paid a spontaneous and
sincere tribute to the child over whom she had gone crazy. What
more could she want? She moved a step in advance, leaving him
free to justify himself with Etta, who agreed with him in the
proposition that Clementina for the last two days was in a very
cranky mood. Very natural, the proposition of the two innocents.
How could they divine that the moisture in Clementina’s eyes had
nothing whatsoever to do with Sheila’s appreciation of the vocal
lamb or her readiness to be carried by Quixtus? How could they
divine that, at the possibility of which the cruelty and insolence of
youth would have caused them both to shriek with inextinguishable
laughter? And how was Tommy, generous-hearted lad that he was,
to know that this one unperceptive speech of his sent him hurtling
out of the land of Romance down to common earth? Henceforward
Tommy, whilst retaining his chamber in Clementina’s heart, was to
walk in and out just as he chose. Not the tiniest pang was he again
to cause her. But what could Tommy know—what can you or I or any
other male thing ever born know of a woman? We walk, good easy
men; with confident and careless tread through the familiar garden,
and then suddenly terra firma miraculously ceases to exist, and
head-over-heels we go down a precipice. How came it that we were
unaware of its existence? Mystère! Who could interpret the soul of
La Giaconda? Leonardo da Vinci least of all. It is all very well to give
a man a vote; he is a transparent animal, and you know the way the
dunderhead is going to use it; but the incalculable and pyrotechnic
way in which women will use it will make humanity blink. Let us
therefore pardon Tommy for staring in amazement at Clementina. He
sought refuge in Etta. From Scylla, perhaps, to Charybdis; but for
the present, Charybdis sat smiling under her fig-tree, the most
innocent and bewitching monster in the world.
Leaving the three children in the compartment, Clementina and
Quixtus walked, for the last few moments before the train started,
up and down the platform.
“I suppose you’ll soon be coming back to London?” said
Clementina.
“I think so,” said he. “Now that the Grand Prix is over Paris is
emptying rapidly.”
“Parrot!” thought Clementina, once more confounding the
instructress; but she said blandly; “What difference in the world can
it make to you whether Paris is empty or not?”
He smiled good-naturedly. “To tell the honest truth, none. Yes. I
must be getting home again.”
“Of course there’ll be a certain amount of worry over
Hammersley’s affairs,” she said; “but I hope you’ve got something
else to do to occupy your mind.”
“I want to settle down to systematic work,” replied Quixtus.
“What kind of work?”
“Well,” said he, with an apologetic air, “I mean to extend my little
handbook on ‘The Household Arts of the Neolithic Age’ into an
authoritative and comprehensive treatise. I’ve been gathering
material for years. I’m anxious to begin.”
“Begin to-morrow,” said Clementina. “And whenever you feel
lonely come and read bits of it to Sheila and me.”
And thus came about the surprising and monstrous alliance
between Clementina and Prehistoric Man. Dead men’s jawbones had
some use after all.
“En voiture!” cried the guard.
“Good-bye, my dear Clementina,” said Quixtus, “we have had a
memorable meeting.”
“We have, indeed. You are sending away three very happy
people.”
“Why not four?”
But she only smiled wryly and said: “Good-bye, God bless you.
And keep out of mischief,” and clambered into the train.
The train began to move, to the faint strains of the “Jewel Song”
in Faust, and Sheila blew him kisses from the carriage window. He
responded until the little white face disappeared. Then he thought of
Clementina.
“The very best, but the most enigmatic woman in the world,” said
he.
Which was a very sweeping statement for a man of his scientific
accuracy.
Entirely ignorant of the word of the enigma, he went back to the
spotless flower of insulted womanhood, who took him off to lunch
with her French friends. She welcomed his undivided homage. That
fishfag of a creature, as she characterised Clementina in
conversation with Lady Louisa, made her feel uncomfortable. Even
now that she had gone, the problem of Quixtus’s removal from her
sphere of influence remained. The child was the stake to which he
was fettered within that sphere. Could she break the chains? Therein
seemed to lie the only solution—unless by audacity and adroitness
she uprooted the stake and carried it, with Quixtus, chains and all,
into her own territory.
She had a talk after lunch with Huckaby. The luncheon-party had
broken up into groups of two or three, who wandered about the cool
enclosure of the Bois de Boulogne restaurant where the feast had
been given, and, half by chance, half by design, the two had joined
company. Their conversation on the evening of Quixtus’s departure
from Paris had deeply affected their mutual relations. Each felt
conscious of presenting a less tarnished front to the other, and each,
not hypocritically, began to assume a little halo of virtue in the
pathetic hope that the other would be impressed by its growing
radiance. During the few days of Quixtus’s absence they had become
friends and exchanged confidences. Huckaby convinced her of the
sincerity of his desire to reform. He described his life. He had worked
when work came his way—but work has a curious habit of shrinking
from the drunkard’s way; a bit of teaching, a bit of free-lance
journalism, a bit of hack compilation in the British Museum; he had
borrowed far and wide; he had not been over-scrupulous on the
point of financial honour. Hunger had driven him. Lena Fontaine
shivered at the horrors through which he had struggled. All he
desired was cleanliness in life and body and surroundings. She
understood. Material cleanliness had been and would be hers; but
cleanliness of life she yearned for as much as he did. But for him,
the man, with the given boon of honourable employment, it was an
easy matter. For her, the woman, tired and soul-sick, what avenue
lay open? She, in her turn, told him of incidents in her career at
which he shuddered. “Throw it up, throw it up,” he counselled. She
smiled bitterly. What could be the end of the bird of prey who
assumed the habits of the dove? She could marry, he replied, before
it was too late. Marry, ay! But whom? She had not dared confide to
him her hope. So close, however, being their relations, Huckaby had
not failed to acquaint her with the important scope of his
conversation with Quixtus the day before. Quixtus’s changed
demeanour, obvious to her at once, confirmed his announcement.
She welcomed it with more joy than Huckaby could appreciate. For
behind the pity that had paralysed beak and talon, the new-born
hope and the curious liking she had conceived for the mild, crazy
gentleman, stalked the instinctive aversion which the sane feel
towards those whose wits have gone ever so little astray. The news
had come as an immense relief. Now she could meet him on normal
ground. All was fair.
They found two chairs by a little table under a tree, at the back
of the Châlet Restaurant and secluded from the gaiety and laughter
of the front. Nothing human was in sight save, through the tall,
masking acacias and shrubs, the white gleams of cooks and
hurrying, aproned waiters.
“Let us sit,” she said. “How good it is to get a little cool and
quiet. This vie de cabaret is getting on my nerves. I’m weary to
death of it.”
Huckaby laughed. “It’s still enough novelty to me to be pleasant.”
She accepted a cigarette. They smoked for a while.
“How’s goodness getting on?” she asked.
“By leaps and bounds daily. I’m becoming a fanatical believer in
the copy-book. I’m virtuous. I’m happy. Industry is a virtue. My
virtue is to be rewarded by industry. Therefore virtue is its own
reward.”
“What industry?”
“I’m going to collaborate with our friend in the new book he’s
talking about,” replied Huckaby, with a surviving touch of
boastfulness. “There is also a possibility of my taking over the
secretaryship of the Anthropological Society.”
“You’re lucky,” said Lena Fontaine.
“How’s goodness with you?”
“The usual slump. Shares going dirt cheap. No one seems to
have any use for virtue in a woman.”
“Husbands seem to have, as I’ve already suggested to you.”
“Have you any particular husband to suggest?”
He cast on her a glance of admiration, for in her outward
seeming she was an object for any man’s forgivable desire, and he
said in a tone not wholly of banter:
“The humble individual in front of you would have no chance, I
suppose?”
She laughed. “None whatever.”
“You’ll pardon my presumption in making the offer; but could I,
en galant homme, do otherwise?”
“No,” she replied, good-humouredly, “you couldn’t. If you had
five thousand a year, it would give me to think, for you’re not
unsympathetic. But as you haven’t, I’ve no use for you—as a
husband, bien entendu.”
It was a jest. They laughed. Presently a cloud obscured the
sunshine of her laughter. She leaned over the table.
“Eustace Huckaby, are you or are you not my friend?”
For once in her dealings with a man whose goodwill she
desperately craved, she was sincere. She dropped the conscious play
of glance and tone; but she forgot the liquid splendour of her eyes
and the dangerous nearness of her face to his.
“Your friend?” he cried, laying his hand on her wrist. “Can you
doubt it? I am indeed. I swear it.”
“Do you know why I’m staying here—apparently wasting my
time?”
“I’ve supposed something was up; but my supposition seemed
too absurd!”
“Why absurd?”
“Quixtus as a husband?”
“Yes. Why not?”
He released her wrist and fell back in his chair. He frowned and
tugged at his beard.
“Do you care for him?”
“Yes. In a way. I sincerely do. If you mean—have I fallen
desperately in love with him?—well, I haven’t. That would be
absurd. It’s not my habit to fall in love.”
“What would you get out of it?”
She made an impatient gesture. “Rest. Peace. Happiness. He’s a
wealthy man and would give me all the comfort I need. I couldn’t
face poverty. And he would be kind to me.”
“And he—pardon the brutality of my question—what would he
get out of it?”
“I’m a lady, after all,” she said, “and I know how to run a large
house—and as a woman I’m not unattractive. And I’d run straight.
Temperamentally I am straight. That’s frank. Whatever impulses I’ve
had within me with regard to running off the rails have been the
other way. Oh, God, yes,” she added, with a little shiver and averted
eyes, “I’d run straight.”
“What about ghosts of the past rising up and queering things?”
“I’d take my chance. I’ve bluffed myself out of tight places
already, and I could bluff again.”
Huckaby lit another cigarette. “He looks on you as a spotless
angel of purity,” said he. “If he married you on that assumption, and
learned things afterwards, there would be the devil to pay. He’s been
hit like that already, and he went off his head. I shouldn’t like him to
have another experience. Why not tell him something—just a little?”
She raised both hands in nervous protest. “Oh, no, no. The
woman who does that is a fool. It never comes off. Let him take me
for what he thinks I am, and I’ll see that I remain so. Trust me. It
will be all right. You’re the only impediment.”
“I?”
“Of course. You have it in your power to give me away at any
time. That’s why I asked you whether you were my friend.”
Huckaby tugged at his beard, and pondered deeply. He meant,
with all the fresh energy of new resolve, to be loyal to Quixtus. But
how could he stand in the way of a woman seeking salvation? Moral
sense, however, is a plant of gradual growth. Huckaby’s as yet was
not adequate to the solution of the perplexing problem. Lena
Fontaine held out her hand, palm upward, across the table.
“Speak,” she said.
He took her hand and pressed it.
“I’ll be your friend in this,” said he.
She thanked him with her eyes, and rose.
“Let us go back to the others, or they’ll think we’re having a
horrible flirtation.”
On this and on the succeeding days she discovered a subtle
change in Quixtus’s attitude towards her. His manner had grown, if
possible, more courteous; it betrayed a more delicate admiration, a
more graceful homage to the beautiful and charming woman. Before
his Marseilles visit she had found it an easy task to appeal to the fool
that grins in every man. A trick of eyes and voice was enough to set
him love-making in what she had termed the Quixtine manner. Now
the task was more difficult. She found herself confronted by a
greater sensitiveness that did not respond to the obvious invitation.
He was up in the clouds, more chivalrous, more idealistic. With a
sigh, she gathered her skirts together and climbed to the higher
plane.
And all this on Quixtus’s part was sheer remorse—atonement for
the unspeakable insult. The thought of having dared to make coarse
love to this exquisite creature filled him with horrified dismay. That
the lady had appeared rather to like the coarse love-making he did
not stop to consider. Certainly, in his crazy exultation, he had
proclaimed her a fruit ripe to his hand, but that was only an
additional vulgarity which had stained that peculiar phase of his
being. The result of the reaction was to accentuate the reverential
conception of woman, which, by reason of a temperament dreamy
and poetic and of a scholarly life remote from the disillusionising
conflicts of sex, he had always entertained. He comported himself
therefore towards her with scrupulous delicacy, resolved that not a
word or intonation that could be construed into an affront should
ever pass his lips.
The fine weather broke. Torrential rains swept Paris. The
meteorologists talked learnedly about cyclonic disturbances in the
Atlantic which would affect the weather adversely for some time to
come. Lena Fontaine began to reflect. Summer Paris in rain is no
place for junketing, even on the high planes. It offers to the visitor
nothing but the boredom of hotel and restaurant. She knew the
elementary axiom of sex relations, that the woman who bores a man
is lost. The high planes were all right when you looked down from
them on charming objective things; but, after all, a man has to be
amused, and fun on the high planes is a humour dangerously
attenuated. She announced an immediate departure from Paris.
“If you would accept the escort of Huckaby and myself, we
should be honoured,” said Quixtus. “Unless of course we should be
in the way.”
She laughed. “My dear friend, did you ever hear of men being in
the way when women were travelling? A lone woman is never more
conspicuously lonesome than en voyage. All the other women
around who have men to look after them look at one with a kind of
patronising pity, as though they said; ‘Poor thing that can’t rake up a
man from anywhere.’ And it makes one want to scratch.”
“Does it really?” smiled Quixtus.
“It does.” She laughed again and sighed. “A lone woman has
much to put up with. Malicious tongues not the least.”
“My dear Mrs. Fontaine,” said he, “what tongue could be so
malicious as to speak evil of you?”
“There are thousands in this gossipy world. Our little friendship
and camaraderie of the last fortnight—sweetness and innocence
itself—who knows what misinterpretation slanderers might put on
it?”
Quixtus flushed, and drew his gaunt body to its full height. “I’m
not pugilistic by habit,” said he, “but if any man made such an
insinuation, I should knock him down.”
“It would be more likely a woman.”
“Then,” said he, “I think I could manage to convey to her,
without brutality, that she was a disgrace to her sex.”
She fluttered a glance at him. “I should like to have you always
as a champion.”
“If I understand the word gentleman aright,” said Quixtus, “he is
always the champion of the unprotected woman.”
His tone assured her that this Early-Victorian sentiment was not
mere gallantry. He meant it, indignant still at the idea of
misconstruction of their friendship.
“I happen to be a woman,” she said, “and seek the particular
rather than the general. I said my champion, Dr. Quixtus. Now don’t
say that the greater includes the less, or I shall fall through the
floor.”
He was too much in earnest to smile with her in her coquetry.
“Mrs. Fontaine,” said he, with a bow, “no one will ever dare speak
evil of you in my presence.”
She rose—they were sitting in the lounge.
“Thank you,” she said, falling in with his earnest mood. “Thank
you. I shall go back to London with a light heart.”
And like a wise woman, she cut short the conversation, and went
upstairs to dress for dinner.
CHAPTER XXI

J
uly brought in halcyon days for everybody.
They were halcyon days for Clementina. There were neglected
portraits to complete, new sitters for whom to squeeze in
appointments, a host of stimulating things, not the least of which
was the beloved atmosphere, half-turpentine, half-poetry, of the
studio. Only the painter can know the delight of the mere feel of the
long-forsaken brush, and the sight of the blobs of colour oozing out
from the tubes on to the palette. Most of us, returning to toil after
holiday, sigh over departed joys. To the painter the joy of getting
back to his easel is worth all the joys that have departed. Clementina
plunged into work as a long-stranded duck plunges into water. By
rising at dawn, a practice contrary to her habit, she managed to
keep pace with her work and to attend to the various affairs which
her new responsibilities entailed. Her days were filled to overflowing,
and filled with extraordinary happiness. A nurse was engaged for
Sheila, a kind and buxom widow who also found herself living in
halcyon days. She could do practically whatever she liked, as her
charge was seldom in her company. The child had her being in the
studio, playing happily and quietly in a corner, thus realising
Clementina’s dream, or watching her paint, with great, wondering
eyes. The process fascinated her. She would sit for an hour at a
time, good as gold, absorbed in the magic of the brush-strokes,
clasping the dingy Pinkie tight against her bosom. Tommy appeared
one day with a box of paints, a miniature easel, and a great mass of
uncoloured fashion-plates of beautiful ladies in gorgeous raiment. A
lesson or two inspired Sheila with artistic zeal, so that often a sitter
would come upon the two of them painting breathlessly, Clementina
screwing up her eyes, darting backwards and forwards to her
canvas, and the dainty child seated on a milking-stool and earnestly
making animated rainbows of the beautiful ladies in the fashion-
plates.
Then there was the tedious process of obtaining probate of
Hammersley’s will. Luckily, he had wound up all his affairs in
Shanghai, to the common satisfaction of himself and his London
house, so that no complications arose from the latter quarter.
Indeed, the firm gave the executors its cordial assistance. But the
London house had to be interviewed, and lawyers had to be
interviewed, and Quixtus and all kinds of other people, and papers
had to be read and signed, and affidavits to be made, and head-
splitting intricacies of business and investments to be mastered. All
this ate up many of the sunny hours.
Tommy and Etta had halcyon days of their own, which, but by
the free use of curmudgeonly roughness, would have merged into
Clementina’s. Etta had cajoled an infuriated admiral, raving round
the room after a horsewhip, into a stern parent who consented to
receive Tommy, explicitly reserving to himself the right to throw him
out of window should the young man not take his fancy. Tommy
called and was allowed to depart peacefully by the front door. Then
Quixtus; incited thereto by Tommy, called upon the Admiral with the
awful solemnity of a father in a French play, with the result that
Tommy was invited to dinner at the Admiral’s and given as much
excellent old port as he could stand. After which the Admiral called
on Clementina, whom he had not met before. During the throes of
horsewhip hunting he had threatened to visit her there and then and
give her a piece of his mind—which at that moment was more like a
hunk of molten lava than anything else. But the arts and wiles of
Etta had prevailed so that the above scheduled sequence of events
had been observed. Clementina, caught in the middle of a hot
afternoon’s painting, received him, bedaubed and bedraggled, in the
studio, whose chaos happened to be that day more than usually
confounded. The Admiral, accustomed to the point-device females of
his world, and making the spick and span of the quarter-deck a
matter of common morality in material surroundings, went from
Romney Place an obfuscated man.
“I can’t make your friend out,” he said to Etta. “I don’t mind
telling you that if I had seen her, I should never have allowed you to
visit her. I found her looking more like a professional rabbit-skinner
than a lady, and when I went to sit down I had to clear away a
horrid plate of half-finished cold pie, by George, from the chair. She
contradicted me flatly in everything I said about you—as if I didn’t
know my own child—and filled me up with advice.”
“And wasn’t it good, dear?”
“No advice is ever good. Like Nebuchadnezzar’s food, it may be
wholesome but it isn’t good. And then she turned round and talked
the most downright common sense about women I’ve ever heard a
woman utter. And then, by Jove, I don’t know how it happened—I
never talk shop, you know——”
“Of course you don’t, dear, never,” said Etta.
“Of course I don’t—but somehow we got on to the subject, and
she showed a more intelligent appreciation of the state of naval
affairs than any man I’ve met for a long time! As for those
superficial, theoretical donkeys at the Club——”
“And what else, darling?” said Etta, who had often heard about
the donkeys, but now was dying to hear about Clementina. “Do tell
me what she talked about. She must have talked about me. Didn’t
she?”
“About you! I’ve told you.” He took her chin in his hand—she was
sitting on a footstool, her arms about his knee.
“You can’t have told me everything, dear.”
“I think she informed me that her selection of a husband for you
was a damned sight better than mine—I beg your pardon, my dear,
she didn’t say ‘damned’—and then the little girl you’re always talking
of came in, and the rabbit-skinner seemed to turn into an ordinary
sort of woman and took me up, and, in a way, threw me down on
the floor to play with the child.”
“What did you play at, dad? When I was little you used to
pretend to swallow a fork. Did you swallow a fork?”
The iron features relaxed into a smile.
“I did, my dear, and it was the cold pie fork, wiped on a bit of
newspaper. And last of all, what do you think she said?”
“No one on earth could guess, dear, what Clementina might have
said.”
“She actually asked me to sit for a crayon sketch. Said my face
was interesting to her as an artist, and she would like to make a
study of it for her own pleasure. Now what pleasure could anybody
on earth find in looking at my ugly old mug?”
“But, dear, you have a most beautiful mug,” cried Etta. “I don’t
mean beautiful like the photographs of popular actors—but full of
strength and character—just the fine face that appeals to the artist.”
“Do you think so?” asked the Admiral.
“I’m sure.” She ran to a little table and brought a Florentine
mirror. “Look.”
He looked. Instinctively the man of sixty-five touched the finely-
curving grizzled hair about his temples.
“You’re a silly child,” said he.
She kissed him. “Now confess. You had the goodest of good
times with Clementina this afternoon.”
“I don’t mind owning,” said the Admiral, “that I found her a most
intelligent woman.”
And that is the way that all of us sons of Adam, even Admirals of
the British Fleet, can be beguiled by the daughters of Eve.
Halcyon days were they for Quixtus, for whom London wore an
entirely different aspect from the Aceldama he had left. Instead of
its streets and squares stretching out before him as the scene of
potential devilry, it smiled upon him as the centre of manifold
pleasant interests. He had the great work to attack, the final picture
that mortal knowledge could draw of that far off, haunting phase of
human life before the startling use of iron was known to mankind. It
was not to be a dull catalogue of dead things. The dead things, a
million facts, were to be the skeleton on which he would build his
great vivid flesh-and-blood story—the dream of his life, which only
now did he feel the vital impulse to realise. He had his club and his
cronies, harmless folk, beneath whose mild exterior he no longer
divined horrible corruption. From them all he received
congratulations on his altered mien. The change had done him good.
He was looking ten years younger. Some chaffed him, after the way
of men. Wonderful place, Paris. He found a stimulating interest in his
new responsibilities. Vestiges of his perfunctory legal training
remained and enabled him to unravel simple complications in the
Hammersley affairs, much to Clementina’s admiration and his own
satisfaction. He discovered a pleasure once more in the occasional
society of Tommy, and concerned himself seriously with his love-
making and his painting. He spoke of him to Dawkins, the rich donor
of the Anthropological Society portrait, to whom Tommy had alluded
with such disrespect to Clementina. Dawkins visited Tommy’s studio
and walked away with a couple of pictures, after having paid such a
price as to make the young man regard him as a fairy godfather in
vast white waistcoat and baggy trousers. Quixtus also entertained
Tommy and Etta at lunch at the Carlton, Mrs. Fontaine completing
the quartette. “I should have liked it better,” said Clementina, when
she heard of the incident (as she heard all that happened to the
lovers), “I should have liked it better if he hadn’t brought Mrs.
Fontaine into it.” Whereat Tommy winked at Etta, unbeknown to
Clementina.
Quixtus’s friendship with the spotless flower of womanhood
continued. He had tea with her in her prettily-furnished little house
in Pont Street, where he met several of her acquaintances, people of
unquestionable position in the London world, and attended one or
two receptions and even a dance at which she was present. Very
skilfully she drew him into her circle and adroitly played him in public
as a serious aspirant to her spotless hand. There were many who
called him the variegated synonyms of a fool, for to hard-bitten
worldlings few illusions are left concerning a woman like Lena
Fontaine; but they shrugged their shoulders cynically, and viewed
the capture with amused interest. Only the most jaded complained.
If she wanted to give them a sensation, why did she not go a step
further and lead about a bishop on her string? But these
uncharitable remarks did not reach Quixtus’s ears. The word went

You might also like