100% found this document useful (1 vote)
6 views

JavaFX Developing Rich Internet Applications 1st Edition Jim Clarke download

The document is a promotional text for the book 'JavaFX: Developing Rich Internet Applications' by Jim Clarke, Jim Connors, and Eric Bruno, which is available for download in PDF format. It includes links to other related books and resources for developing rich internet applications. The book covers various topics related to JavaFX, including installation, graphic design, user interface creation, and applying special effects.

Uploaded by

calajelukova
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
6 views

JavaFX Developing Rich Internet Applications 1st Edition Jim Clarke download

The document is a promotional text for the book 'JavaFX: Developing Rich Internet Applications' by Jim Clarke, Jim Connors, and Eric Bruno, which is available for download in PDF format. It includes links to other related books and resources for developing rich internet applications. The book covers various topics related to JavaFX, including installation, graphic design, user interface creation, and applying special effects.

Uploaded by

calajelukova
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 62

JavaFX Developing Rich Internet Applications 1st

Edition Jim Clarke pdf download

https://ebookfinal.com/download/javafx-developing-rich-internet-
applications-1st-edition-jim-clarke/

Explore and download more ebooks or textbooks


at ebookfinal.com
Here are some recommended products for you. Click the link to
download, or explore more at ebookfinal

Frameworks Methodologies and Tools for Developing Rich


Internet Applications 1st Edition Giner Alor-Hernández

https://ebookfinal.com/download/frameworks-methodologies-and-tools-
for-developing-rich-internet-applications-1st-edition-giner-alor-
hernandez/

AJAX Rich Internet Applications and Web Development for


Programmers 1st Edition Paul J. Deitel

https://ebookfinal.com/download/ajax-rich-internet-applications-and-
web-development-for-programmers-1st-edition-paul-j-deitel/

Professional BlazeDS Creating Rich Internet Applications


with Flex and Java 1st Edition Shashank Tiwari

https://ebookfinal.com/download/professional-blazeds-creating-rich-
internet-applications-with-flex-and-java-1st-edition-shashank-tiwari/

Learning Flex 3 getting up to speed with rich Internet


applications 1st ed Edition Alaric Cole

https://ebookfinal.com/download/learning-flex-3-getting-up-to-speed-
with-rich-internet-applications-1st-ed-edition-alaric-cole/
Mastering JavaFX 10 Build Advanced and Visually Stunning
Java Applications 1st Edition Sergey Grinev

https://ebookfinal.com/download/mastering-javafx-10-build-advanced-
and-visually-stunning-java-applications-1st-edition-sergey-grinev/

End user Computing Concepts Methodologies Tools and


Applications 1st Edition Steve Clarke

https://ebookfinal.com/download/end-user-computing-concepts-
methodologies-tools-and-applications-1st-edition-steve-clarke/

First Steps Developing Biztalk Applications 1st Edition


Robert Loftin

https://ebookfinal.com/download/first-steps-developing-biztalk-
applications-1st-edition-robert-loftin/

Wireless Internet Handbook Technologies Standards and


Applications 1st Edition Borko Furht

https://ebookfinal.com/download/wireless-internet-handbook-
technologies-standards-and-applications-1st-edition-borko-furht/

Flask Web Development Developing Web Applications with


Python 1st Edition Miguel Grinberg

https://ebookfinal.com/download/flask-web-development-developing-web-
applications-with-python-1st-edition-miguel-grinberg/
JavaFX Developing Rich Internet Applications 1st
Edition Jim Clarke Digital Instant Download
Author(s): Jim Clarke, Jim Connors, Eric J. Bruno
ISBN(s): 013701287X
Edition: 1
File Details: PDF, 7.86 MB
Year: 2009
Language: english
JavaFX™

From the Library of sam kaplan


The Java™ Series

Ken Arnold, James Gosling, David Holmes Mark Hapner, Rich Burridge, Rahul Sharma, Joseph
The Java™ Programming Language, Fourth Edition Fialli, Kim Haase
Joshua Bloch Java™ Message Service API Tutorial and Reference:
Effective Java™ Programming Language Guide Messaging for the J2EE™ Platform
Joshua Bloch Eric Jendrock, Jennifer Ball, Debbie Carson, Ian Evans,
Effective Java™, Second Edition Scott Fordin, Kim Haase
The Java™ EE 5 Tutorial, Third Edition
Stephanie Bodoff, Eric Armstrong, Jennifer Ball,
Debbie Bode Carson, Ian Evans, Dale Green, Jonni Kanerva
Kim Haase, Eric Jendrock The Java™ FAQ
The J2EE™ Tutorial, Second Edition Jonathan Knudsen
Mary Campione, Kathy Walrath, Alison Huml Kicking Butt with MIDP and MSA: Creating Great
The Java™ Tutorial: A Short Course on the Basics, Mobile Applications
Third Edition Doug Lea
Mary Campione, Kathy Walrath, Alison Huml, The Concurrent Programming in Java™: Design Principles
Tutorial Team and Patterns, Second Edition
The Java™ Tutorial Continued: The Rest of the JDK™ Rosanna Lee, Scott Seligman
Patrick Chan JNDI API Tutorial and Reference: Building Directory-
The Java™ Developers Almanac 1.4, Volume 1: Enabled Java™ Applications
Examples and Quick Reference Sheng Liang
Patrick Chan The Java™ Native Interface: Programmer’s Guide and
The Java™ Developers Almanac 1.4, Volume 2: Specification
Examples and Quick Reference Tim Lindholm, Frank Yellin
Patrick Chan, Rosanna Lee The Java™ Virtual Machine Specification, Second Edition
The Java™ Class Libraries, Second Edition, Roger Riggs, Antero Taivalsaari, Jim Van Peursem,
Volume 2: java.applet, java.awt, java.beans Jyri Huopaniemi, Mark Patel, Aleksi Uotila
Patrick Chan, Rosanna Lee, Doug Kramer Programming Wireless Devices with the
The Java™ Class Libraries, Second Edition, Java™ 2 Platform, Micro Edition
Volume 1: java.io, java.lang, java.math, java.net, Rahul Sharma, Beth Stearns, Tony Ng
java.text, java.util J2EE™ Connector Architecture and Enterprise
Kirk Chen, Li Gong Application Integration
Programming Open Service Gateways with Java™ Inderjeet Singh, Beth Stearns, Mark Johnson,
Embedded Server Technology Enterprise Team
Zhiqun Chen Designing Enterprise Applications with the J2EE™
Java Card™ Technology for Smart Cards: Platform, Second Edition
Architecture and Programmer’s Guide Inderjeet Singh, Sean Brydon, Greg Murray, Vijay
Jim Clarke, Jim Connors, Eric Bruno Ramachandran, Thierry Violleau, Beth Stearns
JavaFX™: Developing Rich Internet Applications Designing Web Services with the J2EE™ 1.4 Platform:
JAX-RPC, SOAP, and XML Technologies
Maydene Fisher, Jon Ellis, Jonathan Bruce
Kathy Walrath, Mary Campione, Alison Huml,
JDBC™ API Tutorial and Reference, Third Edition
Sharon Zakhour
Eric Freeman, Susanne Hupfer, Ken Arnold The JFC Swing Tutorial: A Guide to Constructing GUIs,
JavaSpaces™ Principles, Patterns, and Practice Second Edition
Li Gong, Gary Ellison, Mary Dageforde Steve Wilson, Jeff Kesselman
Inside Java™ 2 Platform Security: Architecture, API Java™ Platform Performance: Strategies and Tactics
Design, and Implementation, Second Edition Sharon Zakhour, Scott Hommel, Jacob Royal,
James Gosling, Bill Joy, Guy Steele, Gilad Bracha Isaac Rabinovitch, Tom Risser, Mark Hoeber
The Java™ Language Specification, Third Edition The Java™ Tutorial: A Short Course on the Basics,
Fourth Edition
Chet Haase, Romain Guy
Filthy Rich Clients: Developing Animated and
Graphical Effects for Desktop Java™ Applications

From the Library of sam kaplan


JavaFX ™

Developing Rich
Internet Applications

Jim Clarke
Jim Connors
Eric Bruno

Upper Saddle River, NJ • Boston • Indianapolis • San Francisco


New York • Toronto • Montreal • London • Munich • Paris • Madrid
Capetown • Sydney • Tokyo • Singapore • Mexico City

From the Library of sam kaplan


Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks.
Where those designations appear in this book, and the publisher was aware of a trademark claim, the designations have
been printed with initial capital letters or in all capitals.
Sun Microsystems, Inc. has intellectual property rights relating to implementations of the technology described in this
publication. In particular, and without limitation, these intellectual property rights may include one or more U.S. patents,
foreign patents, or pending applications.
Sun, Sun Microsystems, the Sun logo, J2ME, J2EE, Java Card, and all Sun and Java based trademarks and logos are
trademarks or registered trademarks of Sun Microsystems, Inc., in the United States and other countries. UNIX is a
registered trademark in the United States and other countries, exclusively licensed through X/Open Company, Ltd.
THIS PUBLICATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR
IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS PUBLICATION COULD
INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY
ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS
OF THE PUBLICATION. SUN MICROSYSTEMS, INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN
THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS PUBLICATION AT ANY TIME.
The authors and publisher have taken care in the preparation of this book, but make no expressed or implied warranty of
any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential
damages in connection with or arising out of the use of the information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales,
which may include electronic versions and/or custom covers and content particular to your business, training goals,
marketing focus, and branding interests. For more information, please contact: U.S. Corporate and Government Sales,
(800) 382-3419, corpsales@pearsontechgroup.com.
For sales outside the United States please contact: International Sales, international@pearsoned.com.
Visit us on the Web: informit.com/aw
Library of Congress Cataloging-in-Publication Data:
Clarke, Jim.
JavaFX : developing rich internet applications / Jim Clarke, Jim
Connors, Eric Bruno.
p. cm.
Includes index.
ISBN 978-0-13-701287-9 (pbk. : alk. paper)
1. Java (Computer program language) 2. JavaFX (Electronic resource)
3. Graphical user interfaces (Computer systems) 4. Application
software Development. 5. Internet programming. I. Connors, Jim, 1962–
II. Bruno, Eric J., 1969– III. Title.
QA76.73.J38C525 2009
006.7'6—dc22
2009014387
Copyright © 2009 Sun Microsystems, Inc.
4150 Network Circle, Santa Clara, California 95054 U.S.A.
All rights reserved.
Printed in the United States of America. This publication is protected by copyright, and permission must be obtained
from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by
any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write
to: Pearson Education, Inc., Rights and Contracts Department, 501 Boylston Street, Suite 900, Boston, MA 02116,
Fax: (617) 671-3447.
ISBN-13: 978-0-13-701287-9
ISBN-10: 0-13-701287-X
Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana.
First printing, May 2009

From the Library of sam kaplan


For Debbie, Mike, Tim, and Chris for supporting me in this endeavor.
To my parents who sacrificed so much to allow me this opportunity.
—Jim Clarke

To mom and dad for their unwavering commitment to family.


To Cynthia, Terrence, Nicholas, and Gina without whom I am nothing.
—Jim Connors

To my children, Brandon and Ashley.


—Eric Bruno

From the Library of sam kaplan


This page intentionally left blank

From the Library of sam kaplan


Contents

Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxi
About the Authors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii

Chapter 1 Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


Installing the JavaFX Platform 1
Setting Up NetBeans IDE for JavaFX 1.2 2
Distributing the Application 8
Command Line 9
Eclipse 13
Chapter Summary 18

Chapter 2 JavaFX for the Graphic Designer . . . . . . . . . . . . . . . 19


Graphic Design and JavaFX 19
JavaFX Production Suite 20
Adobe Illustrator CS3 20
Adobe Photoshop CS3 26
Scalable Vector Graphics 30
Chapter Summary 31

Chapter 3 JavaFX Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33


JavaFX Script Basics 33
JavaFX Script Language 34

vii

From the Library of sam kaplan


viii CONTENTS

Class Declaration 36
Mixin Classes 38
Object Literals 40
Variables 41
Sequences 45
Declaring Sequences 45
Accessing Sequence Elements 47
Modifying Sequences 47
Native Array 48
Functions 49
Strings 50
String Literals 50
Formatting 52
Internationalization 52
Expressions and Operators 55
Block Expression 55
Exception Handling 55
Operators 56
Conditional Expressions 57
Looping Expressions 58
Accessing Command-Line Arguments 61
Built-in Functions and Variables 61
Chapter Summary 64

Chapter 4 Synchronize Data Models—Binding and Triggers . . 65


Binding 65
Binding to Variables 66
Binding to Instance Variables 67
When Can a Variable Be Bound? 68
A Simple Example Using Binding 69
Binding with Arithmetic and Logical Expressions 71
Binding and Conditional Expressions 72
Binding and Block Expressions 73
Binding to Function Calls 74
Binding and For Expressions 75
Bidirectional Binding 77
Advanced Binding Topics 80
Binding and Object Literals 80
Bound Functions 84
Triggers 85
Coming Features 91
Chapter Summary 92

From the Library of sam kaplan


CONTENTS ix

Chapter 5 Create User Interfaces . . . . . . . . . . . . . . . . . . . . . . . 93


User Interfaces 93
The Stage 93
The Scene 96
Style Sheets 99
Nodes 105
Custom Nodes 106
javafx.scene.Group 108
Layout 108
Layout Basics 111
Custom Layout 115
Input Events 121
Mouse Events 121
Key Events 123
Text Display 125
Text 125
TextBox 132
JavaFX 1.2 Controls 135
Custom Controls 136
Shapes 140
Paths 144
Java Swing Extension 145
Custom Swing Component 147
Chapter Summary 150

Chapter 6 Apply Special Effects . . . . . . . . . . . . . . . . . . . . . . . 151


Effects 152
Shadowing 153
Lighting 158
Gradients 162
Blurs 167
Reflection 169
Blending 170
PerspectiveTransform 174
Glow and Bloom 176
DisplacementMap 178
Miscellaneous Color Adjustment Effects 179
Chapter Summary 180

Chapter 7 Add Motion with JavaFX Animation . . . . . . . . . . . 181


Computer Animation 181
Timelines 183

From the Library of sam kaplan


x CONTENTS

Key Frames 185


Duration 185
Key Values 187
Key Frames 187
Interpolation 189
Tweening 189
Standard Interpolators 190
Writing a Custom Interpolator 193
Path-Based Animation 199
Total Solar Eclipse Examples 205
JavaFX Shapes 206
JavaFX Production Suite 216
Chapter Summary 218

Chapter 8 Include Multimedia . . . . . . . . . . . . . . . . . . . . . . . . 219


Multimedia 219
Images 219
Media—Audio and Video 225
Chapter Summary 234

Chapter 9 Add JavaFX to Web Pages with Applets . . . . . . . 235


JavaFX and Applets 235
Deploying a JavaFX Application as an Applet 235
NetBeans IDE for JavaFX 238
Manual Generation to Support JavaFX Applets 239
Undocking from the Browser 247
JavaFX and JavaScript Interaction 251
Java Web Start 256
Chapter Summary 258

Chapter 10 Create RESTful Applications . . . . . . . . . . . . . . . . . 259


What Is REST? 259
Representational State Transfer (REST) 260
Building a RESTful System 262
JavaScript Object Notation (JSON) 264
Yahoo! Web Services 265
GeoNames Web Services 266
JavaFX and REST 266
The JavaFX Weather Widget 270
A Mashup Application 273

From the Library of sam kaplan


CONTENTS xi

JavaFX and XML 277


Chapter Summary 278

Chapter 11 JavaFX and Java Technology . . . . . . . . . . . . . . . . 279


Classes 280
Java Objects 281
Function Parameter and Return Mapping 284
Java Scripting 293
Basic Scripting Evaluation 293
Java Scripting API with Global Bindings 295
Java Scripting API with Compilation 296
Java Scripting API with Error Handling 297
JavaFX Reflection 299
Chapter Summary 302

Chapter 12 JavaFX Code Recipes . . . . . . . . . . . . . . . . . . . . . . 303


JavaFX and JavaBeans 303
Server Call Back 307
Node Effects—Fader and Magnifier 311
Fader 311
Magnify 317
Wizard Framework 319
Progress Bar 325
Slider 327
Matrix 330
Chapter Summary 332

Chapter 13 Sudoku Application . . . . . . . . . . . . . . . . . . . . . . . . 333


How to Access the JavaFX Sudoku Application 334
The Interface 334
Source for the Sudoku Application 336
Packages 336
JavaFX Source Files 336
The Overall Design 338
The Logic 338
The Interface 339
Interfacing with Java Components 342
Chapter Summary 346

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347

From the Library of sam kaplan


This page intentionally left blank

From the Library of sam kaplan


Foreword

It is not often that you get the chance to witness (let alone participate in!) the
birth of a truly disruptive technology. We are now at a juncture where informa-
tion is pervasive—there is a convergence that will allow us to seamlessly move
from one information source to another as we conduct our daily lives. Whether
we are operating our smart phones, watching television, using our laptops, or
interacting with screen-based devices that are yet to be invented, we are con-
stantly connected to the world.
The key to making this vision a reality is the implementation of a common platform
that works across all these screens. The Java platform set the bar for “write once,
run anywhere”; JavaFX raises that bar by allowing us to write rich, immersive
applications that run not only on every platform, but look good on every screen.
JavaFX is more than that, of course. It’s about
• Employing visual effects to make the graphics stand out and appear real
• Adding animation to bring the screen to life
• Engaging the auditory and visual senses to more effectively convey
information
• Combining all of these qualities to create compelling applications that are
also fun to use
Of course, these capabilities are useless if applications cannot be crafted easily
and quickly. Another goal of JavaFX is to make development simpler, easier,
more productive—and more fun. The JavaFX script language was built from the
ground up to support the scene-graph-based programming model, allowing the
code to have a structure similar to the data structures it creates. Instead of looking

xiii

From the Library of sam kaplan


xiv FOREWORD

for an esoteric “main” routine, the primary entry point is a “stage.” The stage has
a “scene,” and “nodes” make up the elements in the scene. The analogy to the
real world should be clear to all.
Second, the language supports, as a first class concept, the notion of binding
between data elements. What used to take many lines of repetitive (and error-
prone) listener code is now represented using a simple bind declaration. As a
result, the display and your data model are automatically kept in sync, without
having to write the many lines of code that would otherwise be required to con-
nect them.
Lastly, the JavaFX platform provides a robust set of framework classes that allow
you to quickly and simply exploit the most advanced features, such as animations,
visual effects, and sophisticated visual transitions. All this adds up to a highly
productive environment that allows you to quickly deploy the most advanced
applications to both desktops and mobile devices in a fraction of the time.
Programmer productivity is only part of the story—rich applications also require
participation from graphic designers and UI designers. JavaFX provides tools to
integrate the graphic design process with the development process. For instance,
the creative folks typically design the application’s look and feel, produce graph-
ical assets, and then hand all of this over to the development team to create the
program logic. The JavaFX Production Suite facilitates this handoff in an effi-
cient way that allows developers and designers to collaborate easily.
When I joined the JavaFX project, I knew that I had embarked on a journey to
create the best Rich Internet Application platform on the planet—a journey that
has only just begun. I invite you to join this journey, with this book as your start-
ing point. It begins with the basics and builds up to deploying a full-fledged
application in JavaFX, covering all the features and capabilities that JavaFX pro-
vides along the way. Once you learn JavaFX, I’m sure you will be just as enthu-
siastic about this technology as I am. I welcome you aboard.
John Burkey
Chief JavaFX architect

From the Library of sam kaplan


Preface

Welcome to Rich Internet Application development with JavaFX.


This book is about creating more engaging user applications using special effects
and animation. In this book, we will focus on using JavaFX for creating Rich
Internet Applications.
Building upon the widely adopted and popular Java Platform, JavaFX provides a
new level of abstraction that greatly simplifies graphical user interface develop-
ment while at the same time bringing all the flexibility that Java technologies
provide. This creates an elegant, yet powerful, platform for building full feature
and compelling applications.

What Is JavaFX?
JavaFX is actually a family of products developed at Sun Microsystems. There
are initiatives for mobile phones, consumer, television, and desktop devices. The
cornerstone to these projects is JavaFX. JavaFX is a platform that includes a high
performance declarative scripting language for delivering and building a new
generation of Rich Internet Applications.
The primary focus of JavaFX is to make graphical user interface development easy
while embracing more compelling features like visual effects, sound, and anima-
tion. JavaFX includes a ready-made framework to support graphic components
and to easily include multimedia features like pictures, video, audio, and anima-
tion. Using the Java platform at its core, JavaFX works seamlessly with the Java
platform and can easily leverage existing Java code. This also allows JavaFX to
leverage the “write once, run anywhere” capability provided with the Java platform.
xv

From the Library of sam kaplan


xvi PREFACE

Why JavaFX?
Anyone who has ever written a graphical user interface application can appreci-
ate the complexity of creating such an application. Though the resulting user
interface can produce a powerful user experience, developing a cool application
can be a daunting task. It takes a skilled developer who knows the graphical lan-
guage and framework inside-out to pull off a well-written UI. JavaFX addresses
this complexity.
Furthermore, graphic design and programming are two distinct skills. Graphic
designers focus on the human interaction with the application, and are more
interested in keeping the human’s interest and making the system intuitive. On
the other side, the program developers are typically concerned with implement-
ing business logic and interacting with back-end servers. It is a rare breed that
masters both of these skills. JavaFX’s goal is to bridge these two crafts by allow-
ing the graphic designer to dabble in an easily understood programming lan-
guage, while at the same time allowing the developer the flexibility to implement
the business rules behind the user interface.
JavaFX does this by
• Simplifying the programming language
• Providing ready-built user interface components and frameworks to sup-
port UI creations
• Making it easy to update existing UI applications
• Providing a cross-platform environment that delivers on “Write Once,
Run Anywhere”

Rich Internet Applications


For many years, the programming paradigm has been centered on a client-server
architecture employing a “thin” client. In this architecture, most of the process-
ing was in the server with the client merely displaying the content. In a thin cli-
ent system, data must be transmitted to the server for processing and a response
sent back. This is very true of the HTML screens introduced with the original
Internet browsers. However, by leveraging compute power on the client side, it is
now possible to perform actions on the client, thereby reducing the round-trip
latency to the server.
A Rich Internet Application is an application that allows a good portion of the
application to execute on the user’s local system. Primarily, the client application

From the Library of sam kaplan


PREFACE xvii

is designed to perform those functions that enhance the user’s experience. Fur-
thermore, communications with the server do not have to be initiated from a user
action, like clicking on a button. Instead, a server itself can update the client with
fresh content asynchronously as needed and without waiting for the end user to
perform some action or by employing other tricks in the client like periodically
polling the server.
So what is old is new again. In a sense this is true, but this really represents an
evolution of the client server paradigm rather than a retrenchment back to the old
days of the monolithic program that did everything. The key to a Rich Internet
Application is striking the proper balance between behavior that should stay on
the client with the behavior that rightfully belongs on the server. JavaFX is a
framework that embraces the Rich Internet Application model.

Why This Book?


JavaFX is a new technology and we set out to help you get started quickly by
exploring key features of JavaFX and how it should be used. We purposely did
not want to do a language reference document as the language itself is fairly sim-
ple. Our main goal is to help you to quickly and productively create cool user
interfaces.
This book’s primary audience is comprised of developers (of all levels) and
graphic designers who need to build Rich Internet Applications. There are differ-
ent types of developers and designers that this book targets:
• Java developers who are currently building Rich Internet Applications
with Java Swing
• Java developers who are interested in learning JavaFX for future projects
• Non-Java application developers who wish to use JavaFX for Rich Inter-
net Application development
• Graphic designers, animators, or motion-graphic designers who wish to
use JavaFX to add special effects, animation, and sound to their creations

How to Use This Book


This book has thirteen chapters. The first four chapters cover the basics of JavaFX,
how to get started, what the graphic designer’s role is, and the basic language.
The next five chapters cover the advanced features you expect in a Rich Internet

From the Library of sam kaplan


xviii PREFACE

Application. These include basic UI design, special effects, animation, multimedia,


and browser display. Chapter 10 covers using JavaFX in a Web Services archi-
tecture. Chapter 11 describes JavaFX’s interaction with the Java platform and
assumes you are knowledgeable about Java. The last two chapters cover JavaFX
code recipes and a complete Sudoku application.

Beyond the Written Page


With the expressive platform that JavaFX provides, it is hard to fully demonstrate all
its capabilities on the written page. To fully appreciate all the features and capabilities
that JavaFX brings, we suggest visiting the book’s Web site http://jfxbook.com.
There, you can see the full color versions of the figures used throughout the book.
Also at the Web site, you can run the demos in full color and experience firsthand
the richness of the animations and multimedia.

We have used a building block approach with basic concepts covered first and
more complex features addressed later in the book, so we suggest you read each
chapter in sequential order. If you are a graphic designer, you may be more inter-
ested in Chapter 2. You can safely start there, then jump back to Chapter 1 to dig
deeper into JavaFX. If you are an “über”-coder, you can safely skip Chapter 2,
but we still suggest you eventually read it just to know what the “dark” side is
doing. Chapter 11 assumes you have a good understanding of the Java platform
and APIs. If you do not plan to comingle your Java classes with JavaFX source
in your application, you can safely skip this chapter. The last two chapters show
some code examples based on the foundations laid down in the earlier chapters.
Here’s the book in a nutshell:
• Chapter 1: Getting Started. This chapter gets you set up and shows the
basics of creating and running a JavaFX program.
• Chapter 2: JavaFX for the Graphic Designer. This chapter explains how
a graphic designer would use JavaFX to create JavaFX Graphical Assets.
• Chapter 3: JavaFX Primer. This chapter covers the basic JavaFX Script
syntax.
• Chapter 4: Synchronize Data Models—Binding and Triggers. JavaFX
Script introduces a data binding feature that greatly simplifies the model-
view-controller design pattern. This chapter explains the concepts of data
binding in the JavaFX Script language.
• Chapter 5: Create User Interfaces. The primary focus of JavaFX is to
create rich user interfaces. This chapter explores the visual components

From the Library of sam kaplan


PREFACE xix

available to create user interfaces and demonstrates how the features of


JavaFX work together to produce a rich user experience.
• Chapter 6: Apply Special Effects. A key to Rich Internet Applications is
applying cool special effects to bring user interfaces alive and make them
appealing to use. This chapter explores the special effects that JavaFX
provides, including lighting, visual, and reflection effects.
• Chapter 7: Add Motion with JavaFX Animation. Animation makes the
user interface vibrant and interesting. This chapter explains the concepts
behind the JavaFX animation framework and provides examples of fade
in/out, color animation, and motion. It also demonstrates an animation
using Graphical Assets generated by the graphic designer.
• Chapter 8: Include Multimedia. This chapter explores how to include
pictures, sound, and videos in your application.
• Chapter 9: Add JavaFX to Web Pages with Applets. (Applets are back
and these are not your father’s applets.) This chapter explores embedding
JavaFX applications within Web pages and shows how to undock the
applet from the Web page and demonstrate interaction with JavaScript.
• Chapter 10: Create RESTful Applications. JavaFX provides frameworks
for working easily with JavaScript Object Notation (JSON) and Extensi-
ble Markup Language (XML). This chapter explores both options.
• Chapter 11: JavaFX and Java Technology. This chapter explores how
JavaFX interacts with the Java platform.
• Chapter 12: JavaFX Code Recipes. Code recipes are general reusable solu-
tions to common situations in programming. This chapter provides an over-
view of some code recipes applicable to programming JavaFX applications.
• Chapter 13: Sudoku Application. This chapter explores creating a
Sudoku game application in JavaFX.
As we introduce topics, we have tried to inject our own experiences to help you
avoid trial and error kinds of mistakes and “gotchas.” Throughout the chapters,
we have sprinkled Developer Notes, Warnings, and Tips to point out things that
might not be obvious. We have also tried to include as many examples and fig-
ures as possible to illustrate JavaFX features and concepts.
This book is intended to cover the general deployment of JavaFX, whether it be
on the desktop, mobile, or eventually the TV profiles. However, there is a bias
toward the desktop version and specific features for JavaFX mobile are not cov-
ered. Still, the basic concepts and features covered in this book will also apply to
these other profiles and to future releases of JavaFX.

From the Library of sam kaplan


Discovering Diverse Content Through
Random Scribd Documents
profession would plunge into a sea of prosperity that might swamp
it. And it is not only the rank and file of the profession that suffers.
Ye celebrated professor, reaching out for glory, yea, into infinite
space, clutching frantically at everything in sight, no matter how
profitless—providing the other fellow doesn’t get the case—often
defeats his own ends. And the great man dies, and is buried, and we
take up a collection for his widow, to meet his funeral expenses, and
sell his library—six feet of earth make all men of a size. Sic transit
gloria mundi.
And when, like dog, he’s had his day,
And his poor soul hath passed away,
Some friendly scribe in tearful mood
Will tell the world how very good
The dear departed doctor was—
And thus win for himself applause.

One of the most potent causes of professional poverty is the


mania of the doctor for a pretense of well-doing. He exhibits this in
many ways. One of the most pernicious is an affectation of contempt
for money. This it is that often impels him to delay the rendering of
his accounts. Oftentimes his patient offers to pay all or part of his
bill. With a lordly and opulent wave of his marasmic hand the doctor
says, “Oh, that’s all right; any time’ll do.” And the triple-plated
medical imbecile goes on his way with a dignified strut that ill befits
the aching void in his epigastric region, and is decidedly out of
harmony with the befringed extremities of his trousers. And then the
doctor apologizes to himself on the ground of a philanthropy that is
but the rankest and most asinine egotism en masque.
When will the doctor understand that payment deferred maketh
the patient dishonest? When will he consider the necessities of his
wife and children as outweighing the feelings of the patient who
owes him money? When will he be a man, and not a time-server and
truckler to appearances? He would take the money did he not fear
the patient might suspect that his doctor was not prosperous. He
wishes the patient to think that the doctor and his family dine with
the chameleons, or are fed by ravens. Yet the medical Elijah waiteth
in vain for the manna-bearing birds—they know him for what he is, a
counterfeit prophet who vainly yearns for the flesh-pots of Egypt—
who has a ponderous and all-consuming desire for pabulum, and a
microcephalic capacity for finance.
Doctors are supposed to be keen judges of human nature. I often
think this is absolutely without foundation. Defective knowledge in
this direction is a very expensive luxury to the medical profession.
The confidence man and sharper cannot fool the average doctor into
buying a gold brick, perhaps, but they can come very near it. The
oily-tongued and plausible man with a scheme finds the doctor his
easiest prey. The doctor has often hard enough work to wring a few
dollars out of his field of labor, and it might be supposed that it
would be difficult to get those dollars away from him, but no, it’s
only too easy. He bites at everything that comes along—he often
rises to a bare hook. Mining stocks, irrigation and colonization
schemes, expensive books that he doesn’t want, will never need and
couldn’t find time to read if he would, histories of his town or state
in which his biography and picture will appear for $100—proprietary
medicine schemes, stock in publications of various kinds; he bites at
everything going—he has embonpoint cerebrale. Oh, but the doctor
is easy! I have very painful memories. The best investment I ever
made was when I paid a fellow for painting a sign for the door of my
consultation room, reading: “Notice—Persons with schemes will
please keep out. I have some of my own to promote.”
It is rather a delicate matter, perhaps, for a college professor to
touch on the evils of medical colleges in their relation to the
business aspect of medicine, but I shall nevertheless speak plainly
and to the point. While theoretically the better class of medical
colleges were founded solely for the advancement of science, it is
none the less true that self-aggrandizement has been the pedestal
on which most of our disinterested giants in the teaching arena have
stood and are standing. Remove the personal selfish interest of
college teachers and most of our schools would be compelled to
close for lack of instructors. Let us be honest with ourselves, please.
Not that self-interest is reprehensible—I hold the contrary. One may
teach for salary, reputation, the love of teaching, or a desire for self-
improvement, it matters not, for if he be of the proper timber he is
the right man in the right place. Self-interest makes better teachers
on the average than philanthropy, providing the primal material is
good.
Granting that self-interest is the mainspring of the college
professor, is he very “long-headed” from a business standpoint? I
submit the following propositions as proving that the average college
professor defeats his own ends.
1. He devotes to teaching, time and labor over and above the
exigencies of ordinary practice, which, if devoted to cultivating the
good-will of the laity, would be much more profitable.
2. While cultivating the acquaintance and friendship of the alumni
of his own school—a few each year—he alienates from himself the
friendship of every alumnus of every rival school, the instant he
begins teaching.
3. He assists in educating and starting in life young, active
competitors to himself.
4. He is unreasonably expected to devote a large percentage of
his time to the gratuitous relief of medical students and physicians.
He may give his time cheerfully, but he yields up his nerve force just
the same.
5. Most college professors are less successful in the long run than
the more fortunate ones of the rank and file who have never aspired
to teaching honors.
6. Greater demands are made on a professor’s purse than if he
were in the non-teaching ranks of medicine. He, more than all
others, is expected to put up a prosperous appearance.
The college clinic—especially of the surgical sort—is far-reaching in
its detrimental effects on professional prosperity. Few or no
questions are asked, and the millionaire is being operated on daily,
side by side with the pauper, free. And the blame does not always lie
with the professor who runs the clinic. General practitioners bring
patients to the free clinics every day, with full cognizance of their
ability to pay well. Why doctors will persist in thus cheapening
surgical art is difficult to conjecture—but they do it just the same.
Of course, the college clinic is supposed to be a theater of
instruction. Often, however, it is but a stage on which comedy-
dramas are enacted. A brilliant operation that nobody six feet away
can see, and an operator bellowing at his audience like the
traditional bull of Basham—in medical terms that confuse but do not
enlighten, terms that are Greek to most of the listeners—this is the
little comedy-drama that is enacted for students who have eyes but
see not; who have ears but hear not. Instruction? Bah! Take the
theatric elements and the plays to the gallery out of some college
clinics and there wouldn’t be a corporal’s guard in attendance.
Worse than the free clinics are the so-called charitable hospitals.
Much has been said of dispensary abuses, but few have had the
courage to say anything in adverse criticism of these institutions.
While nominally founded to fill “a long-felt want”—and the number
of long-felt wants, from the hospital standpoint, is legion—these
hospitals are founded on strictly business principles, save in this
respect—the people who found them feed on their innate capacity to
get something for nothing. The first thing the founders do is to get a
staff of doctors to pull the hospital chestnuts out of the fire. The
members of the staff think that the hospital is performing the same
duty for them, and everything is serene. And so the surgeon goes on
operating on twenty patients—fifteen of whom are able to pay him a
fee—in the hope that one among them all is willing to pay him a fee.
Exaggeration? Well, I cannot swear to the accuracy of the
foregoing, but an eastern surgeon of world-wide fame once told me
that for every patient who paid him a fee he operated on nineteen
for nothing; and this man has no public clinic, either. Is it
conceivable that the nineteen free patients are all paupers? Many of
them go to my friend for operation from very long distances. Ought
the railroads and hospitals to have all the profits? Have we not all
had similar experiences in a lesser degree? With the development of
charitable hospitals far in excess of any legitimate demand, it has
come to pass that surgery is almost a thing unknown in general city
practice. Even the minor operations have left the general practitioner
—to return no more so long as there are free hospitals and
dispensaries. Where is the emergency surgery, of which, in former
days, every practitioner had his share? Railroaded off to the “charity”
hospitals to be cared for gratis.
In a recent conversation with a practitioner of thirty years’
experience, I said, “Doctor, you used to do a great deal of general
surgery throughout this section of the city. Have the hospitals
affected your practice in that direction to any extent?” He replied,
“Surgery with me is a thing of the past. Even emergency cases are
carted off to the nearest hospital. If by chance one does fall into my
hands, it is taken away from me as soon as I have done the ‘first-aid’
work.” Personally, I see very little use in teaching surgery to the
majority of students who intend to practice in our large cities—they
will have little use for surgical knowledge.
Here are three cases in illustration of the way our “charitable”
hospitals antagonize the business interests of the profession:
1.—A very wealthy farmer engaged me to perform an exceedingly
important operation. It was understood that $1,000 was to be the
honorarium. He was afterwards advised to go to a certain “religious”
hospital, where he was operated on by an eminent surgeon, who
received nothing for his services. The patient paid $15 a week for
hospital accommodation, and $25 a day to his family physician, who
remained with him “for company.” What a harmonious understanding
between the patient and his family doctor—and what a “soft mark”
that surgeon was. I had the pleasure of telling the latter of the gold
mine he didn’t find, some time later, and the shock to his system
amply revenged the body surgical.
2.—A patient who was under my care for some weeks and paid
me an excellent fee finally divulged the fact that he had meanwhile
been living at a certain hospital as an “out patient,” at an expense of
$8 a week. He had become dissatisfied with the hospital attention,
he said, and, pretending great improvement, was permitted to get
about out-of-doors.
3.—A man on whom I operated and who paid me my full fee
without argument or question, came to me directly from one of our
large hospitals, where he had been sojourning for several months.
That medical men in hospitals are imposed on is a trite
observation. So long, however, as it appears to be the doctor’s
advantage to be on a hospital staff, plenty of men will be found who
will be glad of the chance. As for the injury which the system inflicts
on the profession at large, that is no argument with the individual.
Human nature operates here as elsewhere. Knowing that the system
is bad, we are all anxious to become victims.
In recommending the payment of salaries to hospital men, the
Cleveland Medical Journal claimed that such a plan will remedy all
the evils incident to the professional side of hospital management. I
do not agree in the opinion that the payment of salaries to the staffs
of institutions for the care of the sick will alone correct the evils of
such institutions. The writer of the aforesaid editorial is incorrect,
also, when he says that an awakening is at hand. No, not at hand; it
is coming, though; the handwriting is on the wall. When the
revolution does come, this is what will happen:
1.—Hospital physicians and surgeons will be paid salaries.
2.—Hospitals will take as free patients or patients who pay the
hospital alone only such persons as rigid investigation has shown to
be indigent. All others will be compelled to pay their medical
attendants, just as in private practice.
3.—Certificates of indigency will be required of every free patient,
such certificate being signed by the patient’s attending physician—
outside of the hospital—and at least two other persons in the
community where he or she resides.
4.—General, and especially country, practitioners will cease to
deceive hospital doctors as to the circumstances of their patients.
One medical man should not impose on another.
Too much trouble, eh? Well, my friends of the hospital and
dispensary—for the same charges should apply to the latter—you
must either take your medicine or the revolution will go farther and
this is what will happen: The profession at large will boycott every
man who runs a college clinic, and every hospital and dispensary
man. It will fight colleges and hospitals to the bitter end.
The day is perhaps not far distant when doctors outside of
colleges and hospitals will run their private practices on the co-
operative plan, thus dealing a death blow to the free clinic and
dispensary. Every man of prominence will have his own private clinic
and advertise it among his patients. What is fair for twenty or thirty
men is fair and ethical for one. Each man can have his own hours for
the poor; he can eliminate the unworthy ones, and, best of all, he
can refer all his dead-beat patients to his clinic. Pride may bring fees
from patients to whom honesty is a thing unknown. The private
hospital will run most of the public hospitals off the earth. There will
be no room for anything but municipal hospitals run squarely and
fairly for charity, and reputable private hospitals run frankly for
pecuniary profit, in which the operation and the attendance fees are
the chief factors. Such hospitals will benefit, not hurt, the profession.
One of the most vital flaws in the business sense of the general
practitioner is his penchant for hero worship. He hears of the
medical tin god from afar, and burns incense on the altar of his
greatness. The great man pats the humble doctor on the back, calls
him a good boy, and tells him just where to take all his cases.
Sometimes he offers to divide fees with him.
The medical tin god is truly a “self-made man in love with his
maker.” He has “genius stamped upon his brow—writ there by
himself.” His evolution is interesting. It is history repeating itself:
Apsethus the Libyan wished to become a god. Despairing of doing
so, he did the next best thing—he made people believe he was a
god. He captured a large number of parrots in the Libyan forests and
confined them in cages. Day after day he taught them to repeat,
“Apsethus the Libyan is a god,” over and over again. The parrots’
lesson learned, Apsethus set them free. They flew far away, even
into Greece. And people coming to view the strange birds, heard
them say, “Apsethus the Libyan is a god; Apsethus the Libyan is a
god.” And the people cried, “Apsethus the Libyan is a god; let us
worship Apsethus the Libyan.” Thus was founded the first post-
graduate school.
The medical Apsethus and the deluded parrots of the medical rank
and file are here, and here to stay, until both are starved out. And
the modest general practitioner looks up to the medical tin god and
wonders “upon what meat does this our Cæsar feed that he hath
grown so great?” The meat of industry? Perhaps. The meat of
prodigious cerebral development? Seldom. The meat of opportunity?
Yea, yea, my struggling brother, “and the devil take the hindmost.”
But, more than all, he hath fed on the meat that the parrots have
brought him—Elijah’s ravens were not a circumstance to those
parrots. “In the kingdom of the blind the one-eyed man is king.”
How long will the general practitioner continue to play parrot to
the medical tin god of the charitable hospital the very existence of
which is a menace to the best interests of the profession—the
profession for which the institution has no charity? In that happy
time to be there will be no tin gods. There will be a more equable
division of work and every prosperous community will have its up-to-
date private hospitals with up-to-date men at the head of them.
As for the post-graduate teacher—good or bad—he is already
defeating his own ends—he is exciting ambitions in the breasts of his
pupils. Here and there among them is an embryo McDowell, a Sims,
or a Battey. The backwoods country produces good, rich blood and
virile brains. And the Sims, and McDowells, and Batteys of the future
will be found in relatively small places, doing good work, and then—
good-bye to the tin god and his horn, “for whosoever bloweth not
his own horn, the same shall not be blown.” And in that day the
parrot shall evolve into an eagle, and the hawk had better have an
eye to windward. Meanwhile, hurrah for the post-graduate school
and its pupils, and more power to the tin gods.
This business handicap is so self-evident that it is hardly necessary
to touch on it. We raise the standard of medical education year by
year, yet the mushroom colleges do not go—they are here to stay. If
one-half the colleges were wiped out of existence there would still
be more than enough to supply the demand for physicians. We have
done the best we could to breed competition by manufacturing
doctors, and we are doing all we can to make that competition first
class—a queer business proposition in force of the oversupply of
doctors. We are unjust, too, to the men we educate, by offering
them inducements to enter an already overcrowded profession—but
so long as human nature is as it is I see no way out of the dilemma.
There was once a time when it appeared a goodly thing for the
chosen few to get together like the “three tailors of Tooley street,”
and, after establishing to their own satisfaction the fact that they
were indeed “the people,” formulated rules for the guidance of the
many. These rules were called “ethics.” And the profession has been
wrestling with its ethics ever since, trying to determine what it was
all about anyhow. The ethical garment of half a century ago no
longer fits—it is frayed and fringed, and baggy at the knees; full
many a patch has been sewed on it, in individual attempts to make
it fit from year to year, until it is now, like the Irishman’s hat,
respectable by age and sentimental association only. And the public,
the ever practical and heartless public, has also wondered what
’twas all about, and exhibits little sympathy for a profession which,
while driveling of ethics, has “strained at gnats and swallowed
camels.”
Who does not remember when all the wiseacres with number
eighteen collars and number five hats seriously discussed the
relative propriety of “Specialty” vs. “Practice Limited,” on professional
cards? How times have changed. And then came the discussion by a
learned society, of the ethical relations of “Oculist and Aurist” to
“Practice Limited to Diseases of the Eye and Ear.” And it was decided
that men who had the former on their cards were not ethical and
could not enter that society. Ye Gods! Is the fool-killer always on a
vacation? Must we always see those long ears waving over the top
of the ethical fence, built by the fat hogs to keep all the little pigs
out of the clover patch? What is the public to think of a profession
that winks its other eye at the man who prints on his cards,
“Diseases of Women Only,” but rolls up it eyes like a dying rabbit at
the sight of a card reading, “Diseases of Men Only?” What has raised
the woman with leucorrhea to a more exalted plane than that
occupied by a man with prostatorrhea, does not appear. Why so
many inconsistencies, and why such hypocrisy!
Sir Astley Cooper had his own private “hours for the poor.” Our
European brethren print their college and hospital positions and all
their titles on their cards. Are they less ethical than we? Homeopathy
is a dead duck over there, and quackery has a hard row to hoe in
Europe—queer, isn’t it?
Our system of ethics has not only been hypocritic, but somewhat
confusing. The young man on the threshold of medicine doesn’t
know “where he is at.” He is confronted by the unwritten law that
only celebrated men and quacks may advertise. Small fry, who
haven’t the ear of the newspapers nor a chance for a college
position, are tacitly ordered to keep their hands off. And the young
fellow watches the career of the big man, who hides every other
man’s light under his own bushel, and marvels much. Especially does
he marvel at the accurate photographs, life histories and clinical
reports of his more fortunate confrères that appear in the
newspapers without their knowledge.
Experiences differ. I haven’t yet got around to newspaper clinical
reports, but it has been my fortune to be “written up” on several
occasions. I do not recall that the newspapers drew on their
imaginations for my photograph. I wish I might think so, and that
their imaginations were distorted—the result was so
uncomplimentary.
So far as I can learn, nobody protests against being legitimately
represented in the newspapers. Why not be honest about it? The
hypocrisy of some men is sickening. Paying clandestinely for
newspaper write-ups is despicable, yet some of the very men who
protest that they “really don’t see how that could have gotten into
the papers,” have paid for the advertising in good “coin of the
realm.” It is queer that the newspapers should write up the most
minute details of the wonderful exploits of some poor fellows,
together with their family histories, and publish their photographs,
without their knowledge or consent—especially queer when we read
in conclusion that “Professor John Doe is the greatest surgeon that
ever lived.” Why not come out and acknowledge that these are paid
for? This would give an equal chance to all, and especially to young
fellows who have money enough to pay for similar things. He who
has not the price should not find fault with the fellow who has, for,
“business is business.” Meanwhile, my young friends, remember that
“big mountains may do what little mountains may not do.”
When Koch’s tuberculin was yet new, soon after it escaped, half-
fledged from the laboratory, only to be captured and made to
perform like a trick monkey for the benefit of the laity, there came a
ring at the phone of a prominent daily paper: “Hello, is this the Daily
Bazoo?” “Huh, huh, it are.” “Well, I’m Dr. Squirtem Galls. I wish you
would send a reporter over here at once. I want to be interviewed
on Koch’s tuberculin.” It is said that $25 changed hands, but I don’t
believe it. The gentleman would never advertise—at that rate—“no
sir-ree.” My informant was once the sporting editor of the War Cry,
and hence unworthy of credence.
And what wonderful contributions the newspaper-great-men are
making to science! The daily paper is the place to study appendicitis
and things. It is not long since I learned from a distinguished
surgeon friend of mine, via a daily paper, that evidence of a blow
having been received on the head is an imperative indication for
craniectomy, whether symptoms are present or not.
In preference to the clandestine methods now in vogue, would it
not be better for men in authority to write signed articles for the
newspapers and intelligently present medical matter to the public?
But that wouldn’t be ethical, would it? Such topics as “Advice to
Young Men,” “Letters to Young Wives” and “How to Keep Healthy,”
must be left to the quacks. We will confine ourselves to the
surreptitious blowing of surgical horns and never mind the false
notes.
Meanwhile, let us stand back and watch the procession of modest
men who never advertise—oh, no! At the head, with haughty mien,
comes Professor Keene Carver, preceded by a herald in blood-red
garb, blowing a large brass horn. Then comes the “bearded lady,”
whose blonde and breezy whiskers so delight the heart of his swell
society clientele. And here comes Rip Van Winkle—a middle-of-the-
road “eclectic,” gathering up his long and weedy beard to keep it
from getting tangled up in the scientific barbed wire fence along the
route. And here comes another sure-enough “regular,” evidently a
medicine man—so rare nowadays. He is riding in a swell turnout and
is on his way to his clinic. How do I know that Professor Windy
Bowels is a regular? Because the gentleman who is riding beside him
to his clinic is a reporter on the Chicago Daily Jib-boom.
I presume that the suggestion that I have made of the advisability
of taking the public frankly into our confidence and giving it accurate
information so far as its comprehension goes, by signed articles, in
preference to clandestine advertising and the promulgation of
fallacious ideas of medicine and surgery, will meet with bitter
opposition. I nevertheless believe that a better education of the
public is the only way to down quackery. The opposition will come
chiefly from the surreptitious advertiser, who sees a prospect of
other men getting the advertisement that he believes to be his
proprietary right.
Then there is the tribe of the Microcephali. The howl of protest will
be long and loud from the pews occupied by these far-famed
champions of medical orthodoxy. “We won’t put our discoveries or
contributions in the newspapers—not ever.” And gazing at their
lemur-like front elevations, we can well believe that they would have
no trouble in establishing a “halibi.”
Apropos of “discoveries,” it may as well be understood that the
public is bound to get the details of them sooner or later, and, when
the time is ripe, the matter should be presented to it in a clear and
intelligible form—comprehensible to the layman.
CHAPTER II

THE PHYSICIAN WHO SUCCEEDS

To a great extent Nature has a commanding influence in the


equipment of the successful practicing physician,—the man who
actually secures the desired results in his treatment of patients,
builds up and retains a good practice, and obtains a financial income
of respectable proportions.
Any man of ability, with the necessary education and training, may
obtain a certain amount of success as a physician and make a
modest income—or drag out a miserable existence; this latter is the
most probable. It is a well-established fact that the great majority of
physicians are not what the world would call prosperous. This is not
because they do not earn enough to secure a competence, but
because they do not get it.
The doctor’s bill is almost invariably the last one paid. His practice
is generally among the middle classes, people whose intentions are
good, but whose incomes are limited. If there is anything left after
the rent, and grocery and butcher and other bills are paid the doctor
will, perhaps, get something on account, but as a rule he doesn’t.
This is mainly owing to the fact that the average physician is a
poor business man; he does not place an adequate value on his
services, and is slack in looking after collections. If pressed by his
wife, or some friend, to be more particular in this respect, his almost
invariable reply will be:
“It would not look well for me to put myself on the same plane
with merchants. Mine is a profession, not a trade. Besides, I’m in
duty bound to do a certain amount of charity work.”
Now charity work is all right in its place. An honest, upright
practitioner will never refuse to respond to a call for his services in
deserving cases because the payment of his fee is uncertain, but this
does not obtain to the extent of virtually making paupers of people
who are actually able to pay. And yet this is really what happens
when a physician conducts his business affairs in a slipshod manner,
and this is what most of them do. There is no excuse or reason for
it.
But we started in to tell of Nature’s part in the equipment of the
successful physician. What is the equipment? The possession of a
robust, healthy physique, a sunny, cheerful disposition, and a fair
knowledge of medicine, and ordinary business ability. All are
essential if real success is to be attained, either in a medical sense,
or in the accumulation of a respectable income.
Let us take two instances for the purpose of comparison. In one
case we have a practitioner with just a fair knowledge of medicine,
but in the possession of all the characteristics mentioned. His very
presence in the sick chamber acts as a tonic to the patient.
Then we have a thin, undersized, nervous, dyspeptic physician;
dissatisfied with himself and the world generally. He is a thorough
master in medicine, and his treatment is more scientific than that of
his less learned brother. His presence in the sick chamber, however,
has anything but a soothing effect on the patient. On the contrary it
irritates him, and the effect of the scientific treatment is nullified.
This is not an exaggerated case. There are thousands of just such
men in practice.
Which practitioner is going to have the greatest meed of success?
The answer is easy—the one who cheers and encourages his patient
by the magnetism of his presence.
Talk as we may, suggestion is a powerful factor in the practice of
medicine. I do not mean by this that suggestion alone will cure
illness (this statement is made without intention of affronting those
who believe in Christian Science). But there is ample evidence to the
effect that suggestion goes a long ways in making medical treatment
effective. It is only the physician whom Nature has equipped in the
manner indicated who can offer the right kind of suggestion and he
does it unconsciously.
A physician of this kind is bound to become popular, and
popularity begets a large practice and commensurate fees, provided
the practitioner is in the right location, and has the business acumen
to place the proper value on his services.
From time immemorial physicians have been imbued with the idea
that they must adhere to a set scale of fees. I am speaking now of
the average doctor, the man with a general practice. All patients, the
laborer and the banker, the wage earner and the millionaire, are
charged the same. In the country districts, the small towns and
cities, this charge is usually one dollar a visit. In the larger places it
is generally two dollars.
Why should this be so? The architect, the attorney, the civil
engineer are all professional men in the same way that the physician
is. Whoever heard of any of them adhering to a set scale of fees in
the same way that doctors do? Invariably they regulate the charge
for their services according to the money value involved, and the
nature of the services required. The man who employs an attorney
in litigation where a large money value is at stake naturally expects
to pay a much larger fee than the man who employs the same
attorney in a minor case. The man who wants plans for a million
dollar building pays the architect greatly in excess of the one who
builds a one thousand dollar house. The principle is sound and all
parties concerned are satisfied.
In the eyes of the Almighty all human lives are of the same value,
and it would be cruelly unjust to attempt to appraise them on a
commercial basis. But this should not prevent a physician from
grading his fees in proportion to the ability of his patients to pay
them. What might seem like a large amount to a wage earner, would
be a mere trifle to one in more affluent circumstances. The lives of
both are equally dear to them, and both are willing to pay the doctor
according to their respective ability.
Custom, the mother of much folly, is the only excuse for adhering
to the old, antiquated system. A physician who is called out of bed
on a stormy night to answer an emergency call from the home of a
coal heaver would not be justified in asking more than the minimum
fee. But why should he perform exactly the same service at exactly
the same charge for one who is able and willing to pay ten times as
much, or even more? It is not sensible, it is not fair.
“But it would be a violation of the code of ethics,” some one may
say. Bah! The code of ethics be —— but that’s another story which
will be told later on in this volume. The plan suggested, however, is
not a violation of the code of ethics. There is nothing unethical in a
physician regulating his fees to please himself, provided no injustice
is done, and none of his patients is oppressed in this respect. There
are certain physicians in the large cities who will not respond to a
call for less than $25. There are others who perform the same
services for $2. Yet both kinds are strictly ethical and are recognized
by the medical authorities as such.
The reason for this wide difference is that the $25 men have used
business tact in the practice of their profession, and elevated
themselves to a position where, by reason of their prominence, they
are justified in naming whatever fees they think they can get. And
these fees are almost invariably cash.
On the other hand the $2 men are timid in a business way; they
hide their light under a bushel as it were, and consequently lack
widespread reputation. Their fees remain at $2 because they don’t
ask any more, and their ledgers are laden with unpaid accounts.
There is no reason why a physician should not collect his bills with
just as much promptness as a merchant. It is usually his own fault
that they go unpaid. Statements should be sent out regularly on the
first of each month, and if there is no remittance by the 15th, it can
be found inconvenient to make any further calls. This, of course, is
allowing that the patients are able to pay. Where real inability to
meet the bill exists it becomes a matter for the physician to settle
with his own conscience.
Our medical schools are full of young men who are wasting their
time and doing the world at large an absolute injustice by studying
medicine. They are doomed to failure before they are well started
because Nature has not endowed them with necessary qualifications
for successful practitioners. Their instructors realize it, but the tuition
fees are needed for the support of the schools, and year after year
big crops of alleged “doctors” are turned out. It might be unfair to
refer to them as incompetent, and yet this is what many of them
really are. Most of them know medicine theoretically and know it
well, but lack the vital essentials of success.
It would be a simple matter of justice to these young men if some
plan could be devised for weeding out those who are manifestly
unfitted for the practice of medicine before they have wasted their
time and money on medical instruction. So long as such a plan is
lacking it becomes the duty of the individual to assume this
responsibility himself. The mere desire to become a physician should
not satisfy the aspirant for medical lore. He should question himself
closely as to his fitness. His character may be the best, his ability to
acquire the necessary knowledge unlimited, but unless Nature has
equipped him as previously outlined, the most he can hope to attain
in the medical profession is mediocrity so far as actually helping the
sick, and obtaining prestige and wealth are concerned.
There are men, it is true, of high standing in the profession, who
do not possess these qualifications, but they are few in number and,
as a rule, are consulting, rather than practicing physicians. Other
doctors call upon them for advice because of their recognized skill
and learning. They give this advice wisely and well, but in the sick
room would fall far short of obtaining the same results which other
men, more favored by Nature, obtain by acting upon the advice they
give.
Time was when the word “physician,” conveyed the idea of a man
with a beard. The two were intimately connected in the public mind.
In many parts of the country, especially in remote districts where
modern ideas and knowledge of the germ theory have not
penetrated, this relationship still exists. In such places a full beard is
an efficient badge of the doctor’s calling, and is essential in
establishing his professional identity among the people.
Despite the widespread knowledge of the fact that beards are
nothing more nor less than nests and hatching beds in which
millions of disease germs find shelter, there are to-day numerous
localities in which doctors as well as the laymen cling stubbornly to
the belief that a physician without a beard is “no good.”
“Go on, neighbor, don’t try to fool me. That man’s no doctor. How
do I know? Why, he ain’t got no beard.”
This is no uncommon statement to encounter in rural regions, and
even in some fair-sized towns. Even the doctors themselves do not
appear to recognize the fact that it is possible to separate their
beards from their profession, and that it would be to the benefit of
their patients and the advancement of their own reputations in the
end to do so.
Modern, well-educated physicians know that many, in fact nearly
all the ordinary ailments, are of germ origin. They also know, for
instance, that a patient suffering from typhoid, or typhus, or some
like disease, is continually reproducing these germs in immense
numbers. For a physician with a full beard to lean over the bedside
of such a patient is to invite millions of these germs to invade his
beard, and wherever he goes he carries these germs with him and
spreads the disease.
It is bad enough when decent precaution is taken as the hair of
the head, the mustache, and even the clothing itself will harbor too
many of the bacilli. But to wear a beard is to greatly increase the
accommodations for these undesirable lodgers. In this way the
health and lives of thousands of people are daily jeopardized.
This is why beards should have no place on the faces of
physicians, and the more highly educated and more progressive the
physicians are the fewer will be the beards found among them.
Another thing is a prime requisite in successful practice and this is
the most scrupulous cleanliness. This refers not only to the person
and apparel of the physician, but to the instruments which he
handles.
Some years ago an Iowa cattleman suffering from a chronic
trouble, came to Chicago for treatment which was administered
hypodermatically. He made fair progress toward recovery, and finally
was in condition to return home where the treatment was continued
by his family physician.
For a time the reports made by the Iowa doctor were of a glowing
nature. Mr. —— was getting along nicely, and the improvement in his
condition was nothing short of miraculous. Suddenly word came that
there was a change for the worse, and the Chicago specialist was
requested to go to Iowa and make an investigation. He did so. On
arriving in the town nearest the patient’s home he first called upon
the local physician and together they drove out to see Mr. ——. The
latter was evidently fast approaching a collapse and the specialist
was at a loss to account for the remarkable change. He was assured
that his instructions had been closely adhered to, both the patient
and the local doctor agreeing upon this point. Finally the specialist
said:
“Doctor, let me see you administer the hypodermatic part of the
treatment.”
The local physician took from his overcoat pocket a hypodermic
syringe without case or other protection. This he stuck into the
bottle of fluid which constituted the treatment, and was about to
make the injection when the specialist shouted:
“Great heavens, doctor, don’t do that! Let me see that syringe a
moment.”
Holding the syringe up to the light the specialist found it extremely
dirty on the inside of the glass barrel, and the needle point covered
with lint. Calling the local physician into an adjoining room he said:
“My God, Doctor, it’s a wonder your patient is not dead. You are
poisoning him to death. How long is it since you sterilized this
syringe?”
“Why, it was sterilized when I got it, wasn’t it?” replied the local
M.D. innocently.
“Yes,” answered the specialist, “and my instructions were that it
should be cleansed with alcohol before and after every injection, and
sterilized in boiling water at least once a week. This has not been
done.”
Then and there the visiting physician opened the eyes of his
country brother as to the grave importance of utter and absolute
cleanliness in all branches of practice, and especially in the
administration of hypodermatic treatments.
For nearly ten weeks this doctor had not cleansed the syringe.
During all this time he had unconsciously been injecting into the
system of his patient the most virulent of poison in the form of the
decomposed lymph which remained in the syringe barrel, as well as
such foreign substances as accumulated on the unprotected needle
of the syringe.
And yet this “doctor” was popular and successful in a way, (in mild
cases), despite his failure to keep up with the progress of modern
thought. He was one of the old-fashioned full-bearded type, ignorant
of germs and germ-theory, and too self-opinionated and set in his
way to keep himself posted as to what is going on in the world of
medicine.
I wish I were able to state honestly that, in the instance here
referred to, the patient recovered, but he did not. The damage had
been done, and it was too late, when the specialist was called in, to
overcome it.
This is a truthful narrative. It is being duplicated in many instances
owing to the ignorance and incapacity of men who, while possessing
diplomas, are really unfitted for the practice of medicine. It
illustrates in a sad, but forceful way, the necessity of being “up to
date,” and mixing common sense with the medical lore acquired in
the schools.
“Costly thy habit as thy purse can buy,” should be the rule. A
physician should never dress flashily, but he should be garbed well.
It creates a good impression. The time and money expended on
improving the personal appearance is well invested. Patronize a
competent tailor. A portly, well-conditioned man, well clothed, and of
sunny, cheerful ways, will work wonders in the practice of medicine.
Impressions are created largely by appearances. The man who looks
affluent, who conducts himself in a good-natured, dignified manner,
will succeed even though he be lacking in a thorough knowledge of
his profession. The man who is slouchy and ill-kempt, and who takes
no pains to be pleasant and obliging, will fail, no matter how well
grounded he may be in the science of medicine. Why? Because he
will repel people instead of attracting them. This same rule holds
good in all lines of business, but it is specially applicable to the
practice of medicine.
CHAPTER III

THE BUGBEAR OF ETHICS

One of the first spooks with which the young practitioner will be
confronted is the bugbear of Ethics—don’t overlook the big E. It will
be in front of him on graduation day, his preceptor will dangle it
before his eyes as he hands him his papers, and it will be continually
bobbing up after he has hung out his shingle.
Now ethics in its place is a good thing. It is especially essential in
the medical profession in which, without a due regard for the
proprieties, many men would be tempted to go astray. And this
temptation is by no means slight at times. But there is such a thing
as overdoing the ethical proposition. It becomes monotonously
annoying for a man to have his every movement watched and
judged from the ethical standpoint by a lot of self-constituted
censors. The average physician, in his bearing toward his younger
brother does not ask himself the old question, “Am I my brother’s
keeper?” Not at all. On the contrary the worst of it is he assumes an
opposite attitude and by his actions asserts “I am my brother’s
keeper.”
In a way these men assume the right to dog and spy upon the
movements of other physicians on the plea that they are doing it for
the benefit of the profession—to see that the great Code of Ethics is
not violated. What they are really after, nine times out of ten, is to
make sure that the young, progressive practitioner who has the tact
and ability to build up a good-paying practice does not encroach
upon their preserves. This is bad enough, but there is a worse side.
In nearly every instance those who howl the loudest about violations
of the code, are gross offenders themselves. This is a bold assertion,
but the proof will be furnished later on.
One of the things specially cited as an unpardonable violation of
ethics is the courting of newspaper and similar publicity.
“My dear boy,” one of these old-time offenders will say, “you must
not allow your name to appear so frequently in print. It is
undignified and unethical. Our profession is one of mighty dignity
and responsibility, and you owe it to yourself and your brother
physicians to avoid anything which tends to lower or debase it. I
know it is only human to seek notoriety of this kind, and that it is
valuable so far as the mere getting of money goes, but we must be
actuated by higher, nobler motives.”
It is practically a certainty—with rare exception—that the man who
gives this advice, is bending every energy, and using every possible
means to secure the same kind of publicity. He knows that fame and
wealth come from keeping one’s name constantly before the public.
In every large city we will find physicians of wealth and fame, of
whose every movement the newspapers seem to have information in
advance. How do they get it? Let us analyze the conditions.
Under his professional obligation Dr. Soakum is bound to observe
and live up to the code of ethics. He prates loud and often about the
beauties of an ethical life, and the uninitiated might well suppose
that his was a model existence in this respect. But, is it not a trifle
strange that whenever Dr. Soakum, owing to his great skill and
fame, is called out of town to attend some prominent personage in
another city the newspapermen know he has been summoned. More
than this, they know where he is going, whom he is going to see,
and what train he is going on. Strange, is it not?
It is no uncommon occurrence to read items like the following in
the daily press:
Dr. Soakum, the distinguished specialist in chronic disorders, left for
San Francisco yesterday, having been summoned by wire to attend the
Hon. Million Moneybags, who is seriously ill with chronic nephritis. The
patient, whose disability at this time is of grave import to a number of
large business transactions, has been under the care of a number of
famous physicians, but his great confidence in the skill of Dr. Soakum led
to the hasty summoning of the latter.
Dr. Soakum, who was seen by our reporter just as he was boarding the
Overland limited confirmed the report. He added that the time of his stay
was uncertain, as the case is a most important one, and may demand his
undivided attention for some weeks. During his absence Dr. Soakum’s
vast practice will be looked after by his associate, Dr. Bleedum. He added
that he was both surprised and annoyed to think the news had leaked
out.

Surprised! Annoyed! Not on your life. This was only a bit of stage
play, of dramatic action, on the part of Dr. Soakum. Real surprise,
real annoyance and real anger would have resulted only from the
failure of the reporter to appear after the careful arrangements
which had been made to ensure his attendance.
How often have many of us read items like the following in the
daily press:

At last there is hope for the consumptive. Dr. Killem, the eminent
specialist, whose success in the treatment of tuberculosis has aroused
wide interest in the medical profession, has made public the details of his
treatment by means of which such wonderful results have been obtained.
“I would have done this long ago,” said Dr. Killem to a reporter for the
Morning Howl, yesterday, “were it not that I desired to be absolutely
certain as to the permanent efficacy of the treatment. Now that there is
no longer room for doubt on this point I feel at liberty to act.
“The essential feature in my method is,”——

And Dr. Killem goes on to give what he calls a professional


statement, so involved and beclouded with high-sounding terms that
the poor reporter makes a sorry mess of this part of his story.
Strange as it may seem this is just what Dr. Killem wants. He
knows his treatment will not stand a scientific analysis by competent
men, and he avoids this by intentionally leading the reporter to
misquote. And then it gives him an opportunity to write a letter of
protest to the newspaper and thus obtain more publicity.
“I’m chagrined,” Dr. Killem will say to his professional brethren.
“That reporter for the Morning Howl has made an ass of me, but I
suppose there is no redress. I gave him a few, a very few facts, out
of kindness, and he has distorted them and made me ridiculous.”
And all the time Dr. Killem is swelling with pride. He has “put
another one over” on the press, and obtained a lot of valuable
publicity that he could not have bought outright. Besides he would
not think of doing such a thing as to pay for advertising—it would be
unethical.
How do you suppose the newspapers get hold of such items?
Reporters are a pretty smart lot of men with noses keenly trained on
the scent of news. But none of them, so far as known, possesses the
gift of being able to tell in advance what is going to occur at a given
time. Smart as they are it would be out of the question for them to
know that Dr. Soakum had been called out of town, or that Dr. Killem
had interesting information to impart to the public, unless they got
tips to this effect, and these tips are just exactly what they get.
None of these physicians have press agents. Perish the thought.
That would be decidedly unethical, and too clumsily convictive. No
siree. They are too smart for that. Most of them, however, especially
those who work the press continually, have private secretaries. The
private secretary work is light, and is attended to by stenographers
and book-keepers, but the title affords a handy cloak for disguising
the press agent. Ostensibly engaged as private secretaries the men
who fill these positions know full well that their one and only duty is
to “boost” the professional prowess of their employers; to keep them
constantly before the public.
Frequently this work is done by men who have no open, direct
connection with the physicians who employ them; are not even seen
around their offices. This is the latest dodge, and is becoming more
and more general. It has one decided advantage in the fact that it is
impossible to trace any collusion between the party who gives out
the news, and the party who is benefited by the publication. It also
has a further advantage. It enables the physician to put on an air of
surprise, should he be questioned by a brother doctor, and say:
“Smith. Who is he? He is not on my office staff, and is certainly
assuming a lot when he pretends to speak for me.”
All of these press agents work on the same lines. They know the
avidity with which city editors grab for news, particularly if it
concerns prominent people. When the occasion arises they get into
communication with some city editor, generally by phone, and a
conversation something like the following ensues:
“Hello, that you Brown? This is Jones. Yes, the same, old man.
Thanks. I’ve just got onto something that looks like a good tip, and I
thought you would like to have it. Dr. Soakum has been called to San
Francisco to attend old Moneybags, the trust magnate. If the old
chap should die it would raise Old Ned in the stock market. I
understand that Soakum goes this afternoon on the U. P. limited.
Oh, don’t mention it. I’m glad to be able to give you the tip. Hope
you’ll be able to get a story out of it.”
Jones, the press agent, does not, of course, tell his city editor
friend that there’s $25 in for him (Jones) if the story is printed. He’s
too smart for that. So far as the city editor knows Jones is simply
trying to do him a favor in a news way. The press agent is also smart
in another direction—he does not call on the same city editor too
often. It might arouse suspicion.
In nearly every city of any size there are a number of newspapers.
Jones works them in rotation, so far as Dr. Soakum is concerned.
First it is the Morning Howl, then the Daily Screech, next the Evening
Whirl, and so on. Between the Dr. Soakum stories Jones works in
items about other people, for the modern press agent is an
enterprising chap who represents a number of clients all eager for
publicity. A good press agent can look after the interests of a
physician, a lawyer, an actor, and a promoter at all the same time,
and not overwork himself. It’s merely a matter of giving out the right
tips in the right way. If the tip looks good the city editor and his staff
does the rest.
To preserve his standing with the newspaper fraternity Jones very
frequently, if he is a real live, first-class press agent, tips off a bit of
actual news, something in which there is no $25 for him, and which
makes the city editors rise up and call him blessed. Incidentally it
also makes them all the more willing to act upon his next tip, and
this is just what Jones wants. He is merely sowing seed for the crop
he is to reap in the near future.
And do reputable physicians countenance this sort of thing? you
may ask. They certainly do; not all of them, it is true, but a big
working majority. The large cities are full of physicians of wealth and
fame who have been literally boosted into prominence by the
newspapers. Fancy the effect upon the public when it reads of Dr.
Soakum being called to attend so distinguished a citizen as the Hon.
Million Moneybags, or references to Dr. Killem, “the eminent
authority on tuberculosis.” It means a stream of dollars rolling into
the pockets of the doctors thus referred to, and puts them in
position to name larger fees.
There are times when as a matter of business precaution the
press agent resorts to opposite tactics. It would not look well to be
lauding Dr. Soakum all the time. So, having previously laid out the
program with the former, the press agent hunts up another physician
who knows how others are prospering through publicity and is not
averse to having some of it for himself. The program is explained to
Dr. Squills, and he writes to the newspapers, bringing to their
attention some supposedly important medical subject. It may relate
to hygiene, bad management of hospitals, unsanitary condition of
street cars, the proper means of stopping the spread of tuberculosis,
anything to attract public attention.
City editors, unless overcrowded with more important matter—and
the press agent generally selects the opportune moment—will print
this kind of “stuff” in full. Having printed it about the first thing they
will do is to send out reporters to ask the “eminent Dr. Soakum” for
his opinion on the subject. This is just what Dr. Squills was induced
to break into print for. Dr. Soakum will endorse the latter’s letter,
praise it warmly and perhaps bring out some new points which
Squills has purposely overlooked. This gives Squills a chance to
come back with a statement as to the importance of the suggestions
made by Dr. Soakum, and the two old hypocrites thus get a lot more
free advertising. All of which means more prominence, more fame,
and more money.
Some years ago—about ten at this writing—a new treatment for
chronic nervous and mental ailments was introduced. Its sponsors
were men of high standing in the profession, instructors in leading
medical colleges. That the treatment had great merit is undeniable;
many wonderful results were accomplished with it. It also had great
money-making possibilities, but the promoters did not know how to
develop this feature.
Finally they engaged a press agent—we’ll call him Mr. Johnson,
because that is not his name. His terms were $50 a week salary, and
a royalty on the business. For three or four days Mr. Johnson did
nothing except post himself as to the scientific features of the
treatment and he was soon able to talk more glibly and intelligently
about it than the physicians in charge. Then one day he said:
“Trot out some of your star cases. I want to look them over.”
Mr. Johnson went over the records carefully and selected one
which seemed to give promise of producing a big free
advertisement. It was that of a well-known, well-to-do merchant in a
neighboring city who a year before had been seized with primary
dementia. Homicidal tendencies developed and his family, on the
advice of prominent alienists, placed him in a sanitarium, the
physicians at which, as well as those called in by the family,
pronounced the case absolutely incurable and hopeless.
In time the new treatment was administered. In ninety days the
patient was discharged as cured, returned to his home, and resumed
charge of his business. To this day he is well mentally and physically,
and no one, unacquainted with his history, would ever think he had
been insane, and confined as a dangerous lunatic.
Having satisfied himself as to the accuracy of the story, Johnson’s
next move was to plan out a line of action. The story to be
acceptable in a news way, and carry plausibility with it must come
from the patient’s home town. It would never do for Johnson to offer
it to the newspapers himself. His connection with it must be carefully
concealed. The first thing he did in this direction was to ascertain
who handled the correspondence that was sent out to the big dailies
from this particular town. He found that it was virtually in the hands
of a Mr. Wheeling, city editor of a local paper.
Armed with this knowledge Johnson took a train and went to the
town in question—it is only a few miles from Chicago—timing himself
so as to arrive there when Mr. Wheeling had finished his rush work
for the day. Arriving there he introduced himself to Wheeling as
follows:
“My name is Johnson. Pardon me for intruding upon you, but I’m
a stranger in town, with a little spare time on my hands, and being
somewhat of a newspaper man myself it seems sort of homelike to
poke around an editor’s den. It’s the best way I have of killing time
and, if it doesn’t annoy you, I’d like to pass away an hour or so
chatting over newspaper work and newspaper men.”
Wheeling, a cordial, whole-souled chap, made Johnson welcome,
and they were soon very friendly, exchanging reminiscences, and
regaling one another with their experiences. Johnson was in no
hurry to spring the trap. He was too smart for that. He produced
some good cigars and, after they had talked for an hour or so,
invited Wheeling to take dinner with him at the hotel. Wheeling
accepted, and after the meal, when fresh cigars were lighted,
Johnson proceeded to set his trap as follows:
“Once a man has the newspaper fever he never gets it out of his
blood, at least not entirely. I’m better off now financially than I could
possibly expect to be working as a reporter or editor, and yet
frequently the old desire to cover an assignment, or write a good
story, takes hold of me, and takes hold hard. It’s galling for a man of
my disposition to run against a good story and not be able to make
use of it, but this is happening with me right along. Why this very
afternoon, in conversation with a business friend just before I met
you, I heard a story that’s a corker, and would make a big sensation
if it ever got into print. But pshaw, what’s the use of talking, I’m
simply not in position to make use of it, and might as well pass it up.
It goes against the grain though, I can assure you.”
“Why not give me the tip?” asked Wheeling. “I’m correspondent
here for quite a list of papers, and a real live story, one that I could
spread on, would mean considerable to me.”
“Well,” replied Johnson, “I don’t mind giving you such facts as I
have, but of course I can’t vouch for their accuracy. All I can say is
that if your investigation establishes the truth of what I have heard
all the big papers will want the story by the column, and then some.”
Johnson then proceeded to outline the story to Wheeling,
hesitating purposely as if not quite sure of the patient’s name, and
giving one that sounded much like it, but was not the real one. The
trap was sprung. Wheeling knew the man, and at once realized that
he was in line for a big Sunday spread. It would not do to waste so
good a yarn on the daily issues in which a stick or two of space
would be the limit when he could place a column or more in each of
the Sunday papers. Wheeling furnished his correspondence at space
rates, so much per column, and he naturally wanted to make the
story as full and complete as possible.
That very night (it was Monday) he visited the home of the
miraculously cured man. The latter talked freely, corroborating all
the important details. Wheeling’s next visit was to the home of the
family physician, and there he got more corroboration. The next
morning he wired the various Sunday editors as follows:

Prominent business man here, after being pronounced incurably insane


by eminent specialists, and confined in asylum, fully restored to reason
by new and novel treatment. Big story. How much?

He was swamped with replies. Every Sunday editor wanted more


or less of it. Most of them wanted it in full, the orders reading
something like this:

If sure of facts, and man is really prominent, send story in full. No


limit. Also get pictures of patient, and others concerned.

The following Sunday morning every newspaper in Chicago fairly


“shrieked” forth the news of the new treatment. It was given to the
public in the form of a first-page story with the emphasis of leaded
type, “scare” heads, and pictures of the patient. The Associated
Press took it up and wired a report to all American papers, while a
condensed statement was cabled abroad.
Nor was this all. Managing editors from New York to San
Francisco, from Toronto to New Orleans, called upon their special
correspondents to rush more particulars by wire. The managing
editors of the Chicago papers instructed their city editors to obtain
statements in full from the physicians interested, as to the scientific
nature of the treatment, its history, etc. (The names and addresses
of these physicians being given in the first story, the locating of them
was easy—it was part of Mr. Johnson’s plan.)
What was the result? The new treatment was immediately
“boosted” into world-wide prominence. Half a million dollars would
not have paid for the publicity it obtained in one week. Indeed it
would have been impossible to buy this kind of publicity—straight
news—at any price. It made fortunes for the men interested. To-day,
ten years after this publicity, these men are still reaping its benefits.
Now these men, it should be remembered, were and are strictly
ethical. They frown upon anything that smacks of violation of the
code. They will not sell the treatment to physicians who advertise.
Their dealings are confined to those who can show a clean bill of
health in this connection. To those who meet the demands in this
respect they furnish the treatment at $27.50 per 2-ounce vial; the
cost of producing it is about 75 cents. Nice profitable business? Well,
rather.
The lesson of all this is that it pays physicians to advertise,
provided they do it in the right way, and are clever enough to
hoodwink their professional brethren as well as the general public on
the question of ethics. The man who openly engages a real press
agent and pays his money for “display ads” in the newspapers is
tabooed, his name is anathema. The man who engages a press
agent quietly to get up schemes by which the gentlemen of the
press may be worked for valuable publicity is thoroughly ethical, and
remains in good standing in the profession.
Wherein lies the distinction? I must confess that it is too fine for
me. Of the two the honor seems to be with the doctor who proceeds
to ask for patients in a straight-forward business-like manner, and
pays the newspapers for the space they give him. On the one hand
we have the man who pays for what he gets, while on the other we
have him who, in reality, is obtaining goods under false pretences.
Just another point about ethics. It is strictly unethical for a
physician to prescribe or administer a remedy the formula of which
he does not thoroughly understand. But thousands of them are
doing it daily. Where is the physician, for instance, who knows in
reality, aside from the proprietors, the composition of Anti-Kamnia,
but does lack of this knowledge stop its widespread use? Not at all.
It’s the same way with acetanalid and scores of other preparations.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like