Java Examples in a Nutshell

( 1 )

Overview

Java Examples in a Nutshell is chock full of practical real-world Java programming examples. The author of the bestsellingJava in a Nutshell has created an entire book of example programs that you can learn from and modify for your own use. If you learn best "by example," this is the book for you.This book is a companion volume to Java in a Nutshell. WhileJava in a Nutshell is a quick-reference at heart, it also includes an accelerated introduction to Java programming. Java Examples in a Nutshell picks up where ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (42) from $1.99   
  • Used (42) from $0.00   
Close
Sort by
Page 1 of 5
Showing 1 – 9 of 42 (5 pages)
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$1.99
Seller since 2007

Feedback rating:

(3076)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

Very Good
1997 Paperback Very good

Ships from: San Jose, CA

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2014

Feedback rating:

(29)

Condition: Good
1997 Paperback Good Connecting readers with great books since 1972. Used books may not include companion materials, some shelf wear, may contain highlighting/notes, and may not ... include cd-rom or access codes. Customer service is our top priority! Read more Show Less

Ships from: Dallas, TX

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2008

Feedback rating:

(105)

Condition: Good
1997 Paperback Good Great reading/study copy. May have highlights and/or notes. Ships Fast! Satisfaction Guaranteed!

Ships from: Skokie, IL

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2009

Feedback rating:

(24028)

Condition: Acceptable
Our feedback rating says it all: Five star service and fast delivery! We have shipped four million items to happy customers, and have one MILLION unique items ready to ship today!

Ships from: Toledo, OH

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2009

Feedback rating:

(25697)

Condition: Good
Giving great service since 2004: Buy from the Best! 4,000,000 items shipped to delighted customers. We have 1,000,000 unique items ready to ship! Find your Great Buy today!

Ships from: Toledo, OH

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2005

Feedback rating:

(4104)

Condition: Good
first Good [ No Hassle 30 Day Returns ] [ Edition: first ] Publisher: O'Reilly Pub Date: 1/15/1997 Binding: Paperback Pages: 397.

Ships from: College Park, MD

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2008

Feedback rating:

(16239)

Condition: Good
O'Reilly Media, 09/08/1997, Paperback, Good condition. Owner's name inside and on edge.

Ships from: Frederick, MD

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2005

Feedback rating:

(21963)

Condition: Good
1997-09-08 Trade Paperback Good Trade paperback (US). Glued binding. 397 p. Contains: Illustrations.

Ships from: Sparks, NV

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$1.99
Seller since 2014

Feedback rating:

(30)

Condition: Good
1565923715 Book is in good condition.

Ships from: Pleasant View, TN

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
Page 1 of 5
Showing 1 – 9 of 42 (5 pages)
Close
Sort by
Java Examples in a Nutshell

Available on NOOK devices and apps  
  • NOOK Devices
  • Samsung Galaxy Tab 4 NOOK 7.0
  • Samsung Galaxy Tab 4 NOOK 10.1
  • NOOK HD Tablet
  • NOOK HD+ Tablet
  • NOOK eReaders
  • NOOK Color
  • NOOK Tablet
  • Tablet/Phone
  • NOOK for Windows 8 Tablet
  • NOOK for iOS
  • NOOK for Android
  • NOOK Kids for iPad
  • PC/Mac
  • NOOK for Windows 8
  • NOOK for PC
  • NOOK for Mac
  • NOOK for Web

Want a NOOK? Explore Now

NOOK Book (eBook)
$17.99
BN.com price
(Save 43%)$31.99 List Price

Overview

Java Examples in a Nutshell is chock full of practical real-world Java programming examples. The author of the bestsellingJava in a Nutshell has created an entire book of example programs that you can learn from and modify for your own use. If you learn best "by example," this is the book for you.This book is a companion volume to Java in a Nutshell. WhileJava in a Nutshell is a quick-reference at heart, it also includes an accelerated introduction to Java programming. Java Examples in a Nutshell picks up where that book leaves off, providing a suite of example programs for novice Java programmers and experts alike. This book doesn't hold your hand or supply detailed explanations of Java syntax or method calls; it simply delivers well-commented working examples that help you explore the wide range of what is possible with Java 1.1. Each chapter concludes with programming exercises that suggest further avenues for building on what you have learned.Java Examples in a Nutshell contains all of the example programs from the first edition of Java in a Nutshell, completely updated for Java 1.1. In addition, the I/O, networking, and GUI chapters have been augmented to include even more practical examples. It also expands on the examples from the second edition of Java in a Nutshell that demonstrate the new features in Java 1.1, including the new AWT event handling model, the JavaBeans API, internationalization, object serialization, and reflection.In addition, this book provides never-before-published programming examples for remote method invocation, database connectivity, and security — important elements of the Java Enterprise APIs. Finally, the book offers a glimpse of the features of "Swing," the set of new components that are part of the forthcoming Java Foundation Classes (JFC).

Designed to accompany Java in a Nutshell, this companion tutorial provides practical, real-world Java programming examples. Intended for novice and advanced Java programmers, the book is grouped by skill level.

Read More Show Less

Editorial Reviews

From Barnes & Noble

Fatbrain Review

Designed to accompany Java in a Nutshell, this companion tutorial provides practical, real-world Java programming examples. Intended for novice and advanced Java programmers, the book is grouped by skill level.

Like his previous Java books, author David Flanagan maintains his cut-to-the-chase approach. He teaches by example, and he doesn't include detailed documentation of the exact syntax and behavior of Java statements. Instead, he includes examples from the first and the second (Java 1.1) editions of Java in a Nutshell. He also covers the new AWT event handling model, the JavaBeans API, internationalization, reflection and object serialization. You will find new programming examples for RMI, database connectivity and security. There are also practical examples for I/O, networking and GUIs. The appendix contains Swing, a set of new, cross-platform, lightweight components that form part of the forthcoming Java Foundation Classes (JFC). The end-of-the-chapter exercises provide further avenues for exploring the Java programming.

Read More Show Less

Product Details

  • ISBN-13: 9781565923713
  • Publisher: O'Reilly Media, Incorporated
  • Publication date: 9/8/1997
  • Series: In a Nutshell (O'Reilly) Series
  • Edition description: Older Edition
  • Edition number: 1
  • Pages: 397
  • Product dimensions: 6.06 (w) x 9.00 (h) x 0.82 (d)

Meet the Author


David Flanagan is the author of the bestselling Java in a Nutshell. When David isn't busy writing about Java, he is a consulting computer programmer, user interface designer, and trainer. His other books with O'Reilly & Associates include JavaScript: The Definitive Guide, Netscape IFC in a Nutshell, X Toolkit Intrinsics Reference Manual, and Motif Tools: Streamlined GUI Design and Programming with the Xmt Library. David has a degree in computer science and engineering from the Massachusetts Institute of Technology.
Read More Show Less

Read an Excerpt


Chapter 11: Java Beans

Defining a Simple Property Editor
A bean can also provide an auxiliary Property Editor for use by a beanbox tool. PropertyEditor is a flexible interface that allows a bean to tell a beanbox how to display and edit the values of certain types of properties.

A beanbox tool always provides simple property editors for common property types such as strings, numbers, fonts, and colors. If your bean has properties of a non-standard type, however, you should register a property editor for that type. The easiest way to "register" a property, editor is through a simple naming convention. If your type is defined by the class X, the editor for it should be defined in the class XEditor. Alternatively, you can register a property editor by calling the PropertyEditorManager.registerEditor( ) method, probably from the constructor of your BeanInfo class. If you call this method from the bean itself, the bean then depends on the property editor class, so the editor has to be bundled with the bean in applications, which is not desirable.

In our YesNoDialog example, we don't define any new data types, but we still have two individual properties that need custom editors. In this case, we register the property editors for individual properties by specifying them in the Property-Descriptor objects returned by the getPropertyDescriptors( ) method of our BeanInfo class.

The PropertyEditor interface can seem confusing at first. Its methods allow you to define three techniques for displaying the value of a property and two techniques for allowing the user to edit the value of a property. The value of a property can he displayed:

  • As a string. If you define the qetAsText( ) method, a beanbox can convert a property to a string and display that string to the user.
  • As an enumerated value. If a property can only take on values from a fixed set of values, you can define the getTags( ) method to allow a beanbox to display a dropdown menu of allowed values for the property.
  • In a graphical display. If you define paintValue( ), a beanbox can ask the property editor to display the value using some natural graphical format, such as a color swatch for colors. You also need to define isPaintable( ) to specify that a graphical format is supported.
The two editing techniques are:
  • String editing If you define the setAsText( ) method, a beanbox knows it can simply have the user type a value into a text field and pass that value to setAsText( ). If your property editor defines getTags( ), it should also define setAsText( ) so that a beanbox can set the property value using the individual tag values.
  • Custom editing if your property editor defines getCustomEditor( ), a bean-box can call it to obtain some kind of AWT component that can be displayed in a dialog box and serve as a custom editor for the property. You also need to define supportsCustomEditor( ) to specify that custom editing is supported.
The setValue( ) method of a PropertyEditor is called to specify the current value of the property. It is this value that should be converted to a string or graphical representation by getAsText( ) or paintValue( ).

A property editor must maintain a list of event listeners that are interested in changes to the value of the property. The addPropertyChangeListener( ) and removePropertyChangeListener( ) methods are standard event listener registration and removal methods. When a property editor changes the value of a property, either through setAsText( ) or through a custom editor, it must send a PropertychangeEvent to all registered listeners.

PropertyEditor defines the getJavaInitializationString( ) for use by beanbox tools that generate Java code. This method should return a fragment of Java code that can be used to initialize variable to the current property value.

Finally, a class that implements the PropertyEditor interface must have a no-argument constructor, So that it can be dynamically loaded and instantiated by a beanbox.

Most property editors can be much simpler than this detailed description would suggest. In many cases, you can subclass PropertyEditorSupport instead of implementing the PropertyEditor! interface directly. This useful class provides no-op implementations of most PropertyEditor methods. It also implements the methods for adding and removing event listeners.

A property that has an enumerated value requires a simple property editor. The alignment property of the YesNoDialog bean is an example of this common type of property. The property is defined as an int, but it has only three legal values, defined by the constants LEFT, CENTER, and RIGHT. By default, a beanbox only knows that the property is an int, so it displays the property as a number and allows the user to enter any integer as a property value. Instead, we would like the beanbox to display one of the strings "left." "center" or "right" as the value, and allow the user to choose from these values when setting the property. This can be done with getTags( ) and setAsText( ) methods of a property editor, as shown in Example 11-6.

This example creates the YesNoDialogAlignmentEditor class, which is registered as a PropertyEditor for the alignnment property by the YesNoDialogBeanInfo class shown in Example 11-5. The property editor subclasses PropertyEditorSupport, so it is relatively short. Notice that it passes Integer objects in the calls to set-Value( ) that are made from the setAsText( ) method. You need to use wrapper objects for any primitive-type properties. The use of the Integer class is also apparent in the definition of getJavaInitializationString( ). The setValue( ) method of PropertyEditorSupport handles notifying registered PropertyChange-Listener objects about changes in the value of the property, so this simple property editor does not need to be aware of the existence of such listeners.

Read More Show Less

Table of Contents

Preface 1. Java Basics
2. Objects, Classes, and Interfaces
3. Applets
4. Graphics
5. Events
6. Graphical User Interfaces
7. Data Transfer
8. Input/Output
9. Networking
10. Threads
11. Java Beans
12. Reflection
13. Object Serialization
14. Internationalization
15. Remote Method Invocation
16. Database Access with SQL
17. Security and Cryptography
Appendix A. JFC and Swing
Index
Read More Show Less

Customer Reviews

Average Rating 5
( 1 )
Rating Distribution

5 Star

(1)

4 Star

(0)

3 Star

(0)

2 Star

(0)

1 Star

(0)

Your Rating:

Your Name: Create a Pen Name or

Barnes & Noble.com Review Rules

Our reader reviews allow you to share your comments on titles you liked, or didn't, with others. By submitting an online review, you are representing to Barnes & Noble.com that all information contained in your review is original and accurate in all respects, and that the submission of such content by you and the posting of such content by Barnes & Noble.com does not and will not violate the rights of any third party. Please follow the rules below to help ensure that your review can be posted.

Reviews by Our Customers Under the Age of 13

We highly value and respect everyone's opinion concerning the titles we offer. However, we cannot allow persons under the age of 13 to have accounts at BN.com or to post customer reviews. Please see our Terms of Use for more details.

What to exclude from your review:

Please do not write about reviews, commentary, or information posted on the product page. If you see any errors in the information on the product page, please send us an email.

Reviews should not contain any of the following:

  • - HTML tags, profanity, obscenities, vulgarities, or comments that defame anyone
  • - Time-sensitive information such as tour dates, signings, lectures, etc.
  • - Single-word reviews. Other people will read your review to discover why you liked or didn't like the title. Be descriptive.
  • - Comments focusing on the author or that may ruin the ending for others
  • - Phone numbers, addresses, URLs
  • - Pricing and availability information or alternative ordering information
  • - Advertisements or commercial solicitation

Reminder:

  • - By submitting a review, you grant to Barnes & Noble.com and its sublicensees the royalty-free, perpetual, irrevocable right and license to use the review in accordance with the Barnes & Noble.com Terms of Use.
  • - Barnes & Noble.com reserves the right not to post any review -- particularly those that do not follow the terms and conditions of these Rules. Barnes & Noble.com also reserves the right to remove any review at any time without notice.
  • - See Terms of Use for other conditions and disclaimers.
Search for Products You'd Like to Recommend

Recommend other products that relate to your review. Just search for them below and share!

Create a Pen Name

Your Pen Name is your unique identity on BN.com. It will appear on the reviews you write and other website activities. Your Pen Name cannot be edited, changed or deleted once submitted.

 
Your Pen Name can be any combination of alphanumeric characters (plus - and _), and must be at least two characters long.

Continue Anonymously
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted April 29, 2000

    Java Examples in a Nutshell review

    Great Book! Although it does have its place in learning java. First of all its not a referenece manual and not ment to teach you everything. Although a great book otherwise and it fits nicely with Java in a Nutshell which should be purchased first. Then I would definitaly get Java Examples second to help put up where the first book left off.. Its really an extension of the first half of Java in a Nutshell. (The second half of Java in a Nutshell is all reference)

    1 out of 1 people found this review helpful.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)