Have one to sell? Sell yours here
Graphic Java 1.1: Mastering the AWT
 
See larger image
 
Tell the Publisher!
I'd like to read this book on Kindle

Don't have a Kindle? Get your Kindle here, or download a FREE Kindle Reading App.

Graphic Java 1.1: Mastering the AWT [Paperback]

David M. Geary (Author), Alan McClellan (Author)
4.2 out of 5 stars  See all reviews (5 customer reviews)


Available from these sellers.



Book Description

Sunsoft Press Java Series July 1997
86307-6 Complete coverage of the JavaTM Abstract Window Toolkit. With Graphic Java you will explore the Java AWT in detail, and learn how to extend it to create the custom components you need for your Java applets and applications. Written for experienced programmers, Graphic Java provides detailed coverage of every aspect of the AWT, including: *Graphics Colors and Fonts *Dialogs *Event Handling *Image Manipulation *Menus *AWT Layout Managers Graphic Java also comes with a complete user interface toolkit built on top of the AWT. The Graphic Java Toolkit (GJT) provides more than 40 custom components, including: *Borders *Rubberbanding *Boxes *Image Buttons *Bargauges *Sprite Animation *Scrollers *Convenience/Font Dialogs The book also includes class diagrams for the both the AWT and the GJT and a comprehensive case study in GUI development. The accompanying CD-ROM includes the complete source code for the GJT, along with all example code from the book ready to run on SolarisTM, Windows 95 and Windows NT systems, as well as the complete 1.0.2 release of the Java Developer's Kit (JDK), Symantec's Cafe Lite, and more.

Editorial Reviews

From the Inside Flap

Preface to the Second Edition
The AWT has undergone an amazing metamorphosis between 1.02 and 1.1. The 1.1 version of the AWT has been fitted with an industrial-strength event model, and support has been added for: lightweight components, clipboard and data transfer, printing, desktop colors and mouseless operation. Many shortcomings of the original AWT have been dealt with in the 1.1 release; for example, the AWT now sports both popup menus and a scrollpane.
Perhaps more importantly, however, the 1.1 version of the AWT is much more solid than the 1.02 version. The 1.1 AWT, with the exception of a few bugs here and there, performs as advertised.
Perhaps the most exciting addition to the 1.1 AWT is support for lightweight components. Lightweight components are less resource intensive than their heavyweight counterparts, and can be transparent with an irregular (non- rectangular) border. Although the 1.1 AWT provides the infrastructure for implementing custom lightweight components, it does not provide any specific lightweight components. In a future release, the AWT will provide lightweight versions of all of the existing (heavyweight) components.
The second edition of Graphic Java is based on the 1.1.2 version of the AWT. 1.1.1 and 1.1.2 were both bug fix releases; the latter hit the streets just as we went to press.
AWT/GJT Coverage
For the second edition of Graphic Java we wanted to deemphasize discussion of the Graphic Java Toolkit. Some of the feedback we received from the first edition of Graphic Java was that the book leaned too much towards the GJT with not enough explicit coverage of the AWT.
We have worked hard to remedy this the second time around, by adding 10 new chapters spanning 350 pages, all of which deal exclusively with the AWT:
Delegation-Based Event Model (AWT 1.1 and Beyond)
The AWT Component Class
Basic Components: Labels, Buttons, Canvases, and Panels
Item Selectables: Checkboxes, Choices, and Lists
Text Components
Scrolling: Scrollbars and Scrollpanes
Windows, Frames, and Dialogs
Lightweight Components
Clipboard and Data Transfer
System Colors, Mouseless Operation, and Printing
Instead of being split evenly between AWT and GJT coverage, as was the case with the first edition, 70% of Graphic Java is now devoted exclusively to the AWT. Also much of the original coverage of the AWT that employed the GJT to illustrate concepts has been rewritten so that it no longer uses GJT components.
Layout manager coverage has been signficiantly beefed up. In our relentless pursuit to provide you with the best GridBagLayout discussion on the planet, 30 new pages dedicated to GridBagLayout have been added to the layout manager chapter.
All of the chapters covering the GJT have been updated, and a good percentage have been rewritten from the ground up, such as the chapter on GJT dialogs.
The Graphic Java Toolkit (GJT)
The Graphic Java Toolkit has undergone significant changes. The GJT's event handling, of course, has been updated to the new event model while other new features of 1.1, such as system colors, have been incorporated into the GJT.
The sprite animation package has been refactored. Sprites are now lightweight components that are animated on a playfield that is an extension of the new DoubleBufferedContainer class, whose forte is displaying lightweight components. A fair percentage of the GJT custom components are now lightweights.
The convenience dialogs have been revamped: they can now display a picture and a panel side-by-side.
Then there are new components: splash screens, bubble help, toolbox, work dialog, color and cursor choices, etc.
We tried to maintain the public interfaces of the original GJT whenever possible, but in some cases we had to make modifications. If you have code that uses the original GJT, it should be a fairly simple matter to slip in the 1.1 version of the GJT, provided that you are using the 1.1 JDK, of course.
GJT JavaBeans
The Graphic Java Toolkit will soon be available in a JAR. Watch comp.lang.java.announce for details.
For Mac Users
Graphic Java now supports the Macintosh!
The CD in the back of the book comes complete with a 1.02 version of the GJT, along with project files for both CodeWarrior and Cafe on the Macintosh. The 1.1 JDK for the Mac was not out when we went to press.
We were pleasantly suprised with the GJT on the Mac. Certainly the state of Java affairs on the Macintosh is greatly improved since the first edition of Graphic Java, and we have confidence that the 1.1 JDK on the Mac will prove to be solid as well.
So if you are a Mac user, here's the bottom line. All of the code discussed in Graphic Java has been implemented under 1.1, and therefore will not work on the Mac until the Mac 1.1 JDK comes out. When the Mac 1.1 JDK comes out, all of the code presented in Graphic Java should run as advertised on the Mac. The 1.02 version of the GJT is provided for those that want to get their feet wet using the 1.02 JDK, and also for anyone unfortunate enough to be unable to upgrade to 1.1.
Finally, we should note that we couldn't resist putting some Mac screenshots of GJT unit tests in the second half of the book. We should note that such screenshots are applets running under the 1.02 AWT on the Mac, and not under the 1.1 AWT as are the rest of the screenshots in the book.

Preface
Graphic Java is meant, first and foremost, to help you master the AWT. Both fundamental and advanced concepts of the AWT are fully explored in the pages that lie ahead. Each AWT component is examined in detail, and AWT Tips are provided to illuminate some of the AWT's dark corners. More than 50 custom components are dissected. We aim to leave no stone unturned.
What You'll Find Inside
After reading Graphic Java, you will have a thorough grasp of how the AWT is designed, and how to best take advantage of that design. The following is a sample of the coverage provided in the pages that lie ahead.
Peers
You will understand the peer architecture of the AWT, along with the pros and cons of the peer approach. For instance, you'll know which Component methods behave differently if invoked before a component's peer has been created, and what to do about it.
Clipboard and Data Transfer
You'll understand the data transfer model employed by the AWT, and how to utilize both local clipboards and the system clipboard. While the AWT only provides the ability to transfer strings to and from a clipboard, Graphic Java shows you how to put other data types on the clipboard, with examples of transferring both images and custom components.
Lightweight Components
In addition to being able to implement lightweight custom components, you'll also know how to drag them across a double buffered container, and even how to animate them on a playfield. You will understand how double buffering works, and why lightweight components should be displayed in a double buffered container. You will know the pitfalls of placing lightweight components in a container, and why lightweight containers must be manually fitted with a layout manager.
Layout Managers
You will have a complete grasp of layout managers, including the behemoth, GridBagLayout, and you will be able to implement custom layout managers with ease. You will understand how to force a container to layout its components, and why it is sometimes necessary to do so.
Internationalization and Serialization
You'll be able to internationalize a graphical user interface, and serialize both AWT components and their event listeners.
Scrolling
You will be able to scroll any number of components in a container by using a scrollpane. You'll also understand the limitations of the scrollpane class and why it is sometimes necessary to have a peerless scrolling framework. Of course, we'll discuss the implementation of such a scrolling framework from the Graphic Java Toolkit, which you are free to use for your own purposes.
Custom Components and Graphic Java
When discussing standard AWT components, we strive to take you one step further, usually by discussing the implementation of a custom component. For instance, when we cover windows, we will discuss the implementation of a splash screen, and when we explore text components, we'll look at field validation, both exit validation and on-the-fly validation. In addition to discussing dialogs in detail, five custom dialogs are examined.
The Graphic Java Toolkit
The Graphic Java Toolkit (GJT) is a collection of more than 45 custom components built using the AWT. The GJT is not a replacement for the AWT—instead it provides custom components that are not found in the AWT. The GJT is freely available; you can download it from:
sun/books/books/Geary/Geary.html
The GJT can be used in any product, even a commercial endeavour, as long as it is not sold as a standalone toolkit. See the license that comes on the CD for the legal details. See “Introducing the Graphic Java Toolkit” on page 559 for an introduction to the GJT.
Strategic Importance of Custom Components
All in all, more than 50 custom components are discussed in the pages ahead, such as: splash screens, bubble help, rubberbanding, sprite animation, image buttons, toolbars, custom dialogs, etc. The custom components are meant to illustrate the ins and outs of implementing custom components, while also providing you with a set of components you can use right alongside the components provided by the AWT.
Graphic Java Content
The 1.1 event model, lightweight components, clipboard and data transfer, desktop colors, mouseless operation, and printing are all thoroughly covered. You'll also find extensive coverage of scrolling, menus (including popup menus), image manipulation, graphics, fonts and fontmetrics, dialogs, text components, etc.
Extending the AWT
In Part 2 of the book, we present the Graphic Java Toolkit (GJT). In all, there are over 45 custom components in the GJT. Among these are components such as:
Image buttons and toolbars
Separators and bargauges
Etched and three-dimensional rectangles and borders
Image and component scrollers
Rubberbands
Convenience dialogs
The GJT also includes image filters and a package of classes for developing sprite animations. You are welcome to use and incorporate the GJT into your own program development.
In describing these custom components, we highlight lessons learned and reveal tricks of the trade for those who'll be developing their own custom components. Along the way, we hope to encourage good programming practices, using Java's object-oriented features to develop elegant, maintainable, and readable code. And we try to do these things in practical terms, so that you can see and learn from examples of real programs.
Audience
This book is written for object-oriented developers working in Java. There are numerous books explaining details of the Java language and how it works vis-a- vis Visual Basic, C, C++, etc. We leave details of how Java works to those books. If you are new to Java, you might want one of those books alongside Graphic Java.
The Graphic Java Toolkit
The CD that accompanies this book includes:
The complete source code for the Graphic Java Toolkit.
Unit test applets for all GJT components, including HTML files for unit test applets.
HTML documentation for all GJT classes
Numerous image files in .gif format developed by Pixelsite
Virtually all these programs are discussed throughout the book. Feel free to borrow, adapt, or extend these for your own purposes.
The Graphic Java Toolkit Package Structure
Table P-1 shows the GJT package structure.

Table P-1 GJT Package Structure

Package: gjt
Contents: This package contains the source files for many of the custom components discussed in Graphic Java.

Package: gjt.animation
Contents: This package contains a set of classes that support sprite animation.

Package: gjt.image
Contents: This package contains a set of classes that provide support for image manipulation such as bleaching or dissolving images.

Package: gjt.test
Contents: This package contains source code for all the component unit tests discussed in Graphic Java.

Package: gjt.rubberband
Contents: This package contains a set of classes that support rubberbanding—stretching lines and shapes over a backdrop without affecting the backdrop.


Internet Sources of Information

There are several online sources of information on Java.

For updates about this book and information about other books in the Sun Microsystems Press Java Series, look on the web at: sun/books/books/Geary/Geary.html
For some of the coolest looking graphics on the planet, take a look at: pixelsight:80/PS/pixelsite/pixelsite.html


Conventions Used in This Book
Table P-2 shows the coding conventions used in this book.
Table P-2 Coding Conventions

Convention: Class names have initial capital letters.
Example: public class LineOfText

Convention: Method names have initial lowercase and the rest of the words have an initial capital letter.
Example: public int getLength()

Convention: Variable names have initial lowercase and the rest of the words have an initial capital letter.
Example: private int length
Example: private int bufferLength
Convention: static variables begin with an underscore.
Example: protected static int _defaultSize = 2;

Note that, for the most part, we refer to methods without their arguments; however, we include the arguments when the discussion warrants including them.


Table P-3 shows the typographic conventions used in this book.

Table P-3 Typographic Conventions
Indicates that the accompanying code, command, or file is available on the CD that accompanies this book.

Typeface or Symbol: courier
Description: Indicates a command, file name, class name, method, argument, Java keyword, HTML tag, file content, or code excerpt.

Typeface or Symbol: bold courier
Description: Indicates a sample command-line entry.
Typeface or Symbol: italics
Description: Indicates definitions, emphasis, a book title, or a variable that you should replace with a valid value.

From the Back Cover

Complete coverage of the JavaTM Abstract Window Toolkit.

With Graphic Java you will explore the Java AWT in detail, and learn how to extend it to create the custom components you need for your Java applets and applications. Written for experienced programmers, Graphic Java provides detailed coverage of every aspect of the AWT, including:

Graphics Colors and Fonts

Dialogs Event Handling

Image Manipulation Menus

AWT Layout Managers

Graphic Java also comes with a complete user interface toolkit built on top of the AWT. The Graphic Java Toolkit (GJT) provides more than 40 custom components, including: Borders

Rubberbanding Boxes

Image Buttons Bargauges

Sprite Animation Scrollers

Convenience/Font Dialogs

The book also includes class diagrams for the both the AWT and the GJT and a comprehensive case study in GUI development.

The accompanying CD-ROM includes the complete source code for the GJT, along with all example code from the book ready to run on SolarisTM, Windows 95 and Windows NT systems, as well as the complete 1.0.2 release of the Java Developer's Kit (JDK), Symantec's Cafe Lite, and more.


Product Details

  • Paperback: 928 pages
  • Publisher: Prentice Hall Ptr; 2nd edition (July 1997)
  • Language: English
  • ISBN-10: 0138630771
  • ISBN-13: 978-0138630775
  • Product Dimensions: 9.1 x 6.8 x 1.7 inches
  • Shipping Weight: 3.2 pounds
  • Average Customer Review: 4.2 out of 5 stars  See all reviews (5 customer reviews)
  • Amazon Best Sellers Rank: #3,084,158 in Books (See Top 100 in Books)

More About the Authors

Discover books, learn about writers, read author blogs, and more.

 

Customer Reviews

5 Reviews
5 star:
 (2)
4 star:
 (2)
3 star:
 (1)
2 star:    (0)
1 star:    (0)
 
 
 
 
 
Average Customer Review
4.2 out of 5 stars (5 customer reviews)
 
 
 
 
Share your thoughts with other customers:
Most Helpful Customer Reviews

2 of 2 people found the following review helpful:
3.0 out of 5 stars not the in-depth tome that I expected, December 8, 1998
By A Customer
This review is from: Graphic Java 1.1: Mastering the AWT (Paperback)
Having read the reviews, I expected a lot of deep information. I was mistaken. It is not a bad book, but if it stands out, it is mostly because the majority of Java authors figure that publishing a poorly documented API is adequate. I'd call this an intermediate level book.

It lacks a permuted index, which is a must for a book like this. A lot of the nitty-gritty information is presented as an aside to demonstrating the examples instead of a well thoughout discussion. Some of these are in the index and some are not.

If you're looking for thorough discussions of the AWT architecture, keep looking. If you're looking for a good discussion of how to use layouts, this might be the book for you.

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


1 of 1 people found the following review helpful:
5.0 out of 5 stars Serious Java developers need to buy this book now!, October 17, 1997
By A Customer
This review is from: Graphic Java 1.1: Mastering the AWT (Paperback)
I concur with the review listed above, but must add that anyone out there trying to use Layout managers must read the 100 pages dedicated to that topic in this book...absolutely the best coverage of GridBagLayout that I have ever seen, including a very demonstrative applet that goes a long way towards helping a person learn how to use this very complex layout manager. The only reason I couldn't rate this book a 10 is that I found several coding errors when examining and running the many, comprehensive examples contained on the CD that accompanies this book. Definitely a must read.
Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No


1 of 1 people found the following review helpful:
4.0 out of 5 stars Thorough, effective, and accurate. Excellent book., September 11, 1997
This review is from: Graphic Java 1.1: Mastering the AWT (Paperback)
There are very many sorry Java books on the market these days. Therefore, I was very glad to discover "Graphic Java", 2nd edition. I found it to be a thorough guide to the AWT. In addition, it is accurate throughout, whereas many books fail to properly explain and use the new event model or other features of JDK 1.1.

The book covers every aspect of the AWT, including events, containers vs components, layout managers, lightweight components, etc. Each discussion is peppered with effective examples that clarify the topic at hand. And, along the way, the authors point out good coding tips, such as the effective use of inner classes for event handling, proper object-oriented design, etc.

As if that all wasn't enough, the second half of the book presents a very useful library of custom components that extend the AWT. The source code for this library is on the CD, and the book explains much of the source in detail. This section is also very valuable in learning to understand the AWT.

In a world full of mediocre, inaccurate Java books, this one is a JOY to read

Help other customers find the most helpful reviews 
Was this review helpful to you? Yes No

Share your thoughts with other customers: Create your own review
 
 
 
Most Recent Customer Reviews



Only search this product's reviews



What Other Items Do Customers Buy After Viewing This Item?


Tag this product

 (What's this?)
Think of a tag as a keyword or label you consider is strongly related to this product.
Tags will help all customers organize and find favorite items.
Your tags: Add your first tag
 

Sell a Digital Version of This Book in the Kindle Store

If you are a publisher or author and hold the digital rights to a book, you can sell a digital version of it in our Kindle Store. Learn more

Customer Discussions

This product's forum
Discussion Replies Latest Post
No discussions yet

Ask questions, Share opinions, Gain insight
Start a new discussion
Topic:
First post:
Prompts for sign-in
 


Active discussions in related forums
Search Customer Discussions
Search all Amazon discussions
   
Related forums


Listmania!


Create a Listmania! list

So You'd Like to...


Create a guide


Look for Similar Items by Category


Look for Similar Items by Subject