by Laura Lemay, David Olhasso, Charles Perkins, and Patrick Winters
201 West 103rd Street, Indianapolis, Indiana 46290
FIRST EDITION
All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability
is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Neither is any liability assumed
for damages resulting from the use of the information contained herein. For information, address Sams.net Publishing, 201 W. 103rd St., Indianapolis, IN 46290.
International Standard Book Number: 1-57521-158-0
Library of Congress Catalog Card Number: 96-68939
99 - 98 - 97 - 96 ------ 4 - 3 - 2 - 1
Interpretation of the printing code: the rightmost double-digit number is the year of the book's printing; the rightmost single-digit, the number of the book's printing. For example, a printing code of 96-1 shows that the first printing of the book
occurred in 1996.
Printed in the United States of America
All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Sams.net Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting
the validity of any trademark or service mark.
Visual J++ is a trademark of Microsoft Corporation.
President, Sams Publishing
Richard K. Swadley
Publishing Team Leader
Dean Miller
Managing Editor
Cindy Morrow
Director of Marketing
John Pierce
Assistant Marketing Managers
Kristina Perry
Introduction | |
1 | An Introduction to Java Programming |
2 | Introducing Visual J++ |
3 | Object-Oriented Programming and Java |
4 | Java Basics |
5 | Working with Objects |
6 | Arrays, Conditionals, and Loops |
7 | Creating Classes and Applications in Java |
8 | More About Methods |
9 | Java Applet Basics |
10 | Graphics, Fonts, and Color |
11 | Simple Animation and Threads |
12 | Creating an Interface Using Visual J++ |
13 | More on Graphical Front Ends |
14 | Using Visual J++'s Integrated Debugger |
15 | COM, ActiveX, JDBC API |
16 | Connecting Java to a Network and Other Tidbits |
17 | Modifiers, Access Control, and Class Design |
18 | Packages, Interfaces, and Exception Handling |
19 | Introduction to JavaScript |
20 | Introduction to VBScript |
21 | Integrating Applets and ActiveX Controls with Scripting |
Appendixes | |
A | Language Summary |
B | Class Hierarchy Diagram |
C | Language Summary |
D | How Java Differs from C and C++ |
E | JavaScript Language Reference |
F | VBScript Language Reference |
Index |
From Laura Lemay:
TO Sun's Java Team, for all their hard work on Java the language and on the browser, and particularly to Jim Graham, who demonstrated Java and HotJava to me on very short notice in May and planted the idea for this book.
From David Olhasso:
To my wife, Alizabeth, who is not only my inspiration for all that I do, but who also accepts and supports the long hours I spend on my projects.
From Charles L. Perkins:
To Patrick Naughton, who first showed me the power and the promise of OAK (Java) in early 1993.
From Patrick J Winters:
I know acknowledgments should be kept short, but because this is my first book, I have to thank those who have helped make this work possible. The thanks I give is not only sincere, but also shows, in a small way, who I am.
To my wife, Colleen Watson, who not only helped me when I couldn't find the proper words, but stayed awake with me on many nights to eke out the last bit of what she knew I had in me.
To my sons Dustin and Zachary, who endured the weekends of seeing my back and hearing the clickety-clack of my keyboard instead of going to movies, playing video games, or simply spending time together.
To my fellow Merrill co-workers (Frank "The Big Cheese," David, Charles, and Jennifer), who picked up the slack while I was dragging myself about the office on two hours of sleep.
To Jane Graver Sandlar, for taking a chance and giving me my first technical writing assignment.
To Big Brothers/Big Sisters of America, who very early in my career allowed a boy to do a man's job.
To Miss Whiteside, my sixth grade Language Arts teacher, who managed to show me so much about literature and writing that, 20 some odd years later, the spark alit in me and I realized I wanted to be a writer.
And finally, to all the people at Sams and Sams.net, who persevered despite all the obstacles I placed in their path.
Laura Lemay is a technical writer and a nerd. After spending six years writing software documentation for various computer companies in Silicon Valley, she decided writing books would be much more fun (but has still not yet made up her mind). In
her spare time she collects computers, e-mail addresses, interesting hair colors, and nonrunning motorcycles. She is also the perpetrator of Teach Yourself Web Publishing with HTML in 14 Days.
You can reach her by e-mail at lemay@lne.com, or visit her home page at http://www.lne.com/lemay/.
David Olhasso's first experience in the PC industry was with the original IBM PC back in 1982. Back then he was writing property management and accounting software using dBase. Since then he has spent his time absorbing and working with all of
the latest and greatest technologies (especially since there seems to be only a six month life cycle these days) as well as collecting quite a few more computers.
David has worked with a wide variety of technologies including wireless packet protocols, world-wide PC networks, custom distributed installation systems, and enterprise wide intranet/Internet systems. David works as an independent consultant
specializing in enterprise Windows NT solutions.
Charles L. Perkins is the founder of Virtual Rendezvous, a company building a Java-based service that will foster socially focused, computer-mediated, real-time filtered interactions between people's personas in the virtual environments of the
near future. In previous lives, he has evangelized NeXTSTEP, Smalltalk, and UNIX, and has degrees in both physics and computer science. Before attempting this book, he was an amateur columnist and author. He's done research in speech recognition, neutral
nets, gestural user interfaces, computer graphics, and language theory, but had the most fun working at Thinking Machines and Xerox PARC's Smalltalk group. In his spare time, he reads textbooks for fun.
You can reach him via e-mail at virtual@rendezvous.com, or visit his Java page at http://rendevous.com/java.
Patrick J Winters' entry into the realm of technical writing took a circuitous route. While working in the restaurant business, his chosen and educated profession, his boss decided to cut costs by automating. Patrick tackled the job of
investigating the options, and upon looking at some very expensive inventory control programs that ran on Apple ][ computers, decided that MBASIC was an easy way to make a living. . .yeah, right!
After receiving his first computers in 1979 (like rabbits they quickly multiplied), Patrick started programming for some small, but immensely rewarding, companies. But after many sleepless nights and endless rewrites, he realized he needed to go back
to school. As his college days drew to a close, he gathered with his fellow students at the local watering hole to discuss where they'd be working. After a myriad of corporate names were tossed out, Patrick said, "I want to be a consultant," to
which they all laughed and simultaneously agreed that nobody becomes a consultant first.
Not being one to heed the advice of those with so little experience, for the next five years Patrick made his living as a consultant, selling himself and his dBASE programs to whomever wanted them. But along came kids, and paid benefits and
steady hours started looking good. Big Brothers/Big Sisters of America provided Patrick with one of the toughest, yet rewarding, educational, and enjoyable work experiences an MIS Director could hope for.
But, all good things had to come to an end; he felt the lure of the consulting road again, but this time as a writera technical writer and online help specialist. After many great assignments at some terrific Fortune 1000 corporations, Merrill
Lynch turned him once again into a full time employee. From there, who knows, but New Mexico is beckoning.
As a reader, you are the most important critic and commentator of our books. We value your opinion and want to know what we're doing right, what we could do better, what areas you'd like to see us publish in, and any other words of wisdom you're
willing to pass our way. You can help us make strong books that meet your needs and give you the computer guidance you require.
Do you have access to CompuServe or the World Wide Web? Then check out our CompuServe forum by typing GO SAMS at any prompt. If you prefer the World Wide Web, check out our site at http://www.mcp.com.
Note: If you have a technical question about this book, call the technical support line at (800) 571-5840, ext. 3668.
As the team leader of the group that created this book, I welcome your comments. You can fax, e-mail, or write me directly to let me know what you did or didn't like about this bookas well as what we can do to make our books stronger. Here's the
information:
FAX:
317/581-4669
E-mail:
Mail:
Comments Department
Sams Publishing
201 W. 103rd Street
Indianapolis, IN 46290
This book is intended to be read and absorbed over the course of three weeks. During each week, you'll read seven chapters that present concepts related to Visual J++.
A Note box presents interesting pieces of information related to the surrounding discussion.
A Technical Note presents specific technical information related to the surrounding discussion.
A Tip box offers advice or teaches an easier way to do something.
A Warning box advises you about potential problems and helps steer you clear of disaster.
New Terms are introduced in New Term boxes, with the term in italics.
A Type icon identifies some new HTML code that you can type in yourself.
An Output icon highlights what the same HTML code looks like when viewed in either Netscape or Mosaic.
An Analysis icon alerts you to the author's line-by-line analysis.