1234567

Java is the preferred language for many of today’s leading-edge technologies—everything from smartphones and game consoles to robots, massive enterprise systems, and supercomputers. If you’re new to Java, the fourth edition of this bestselling guide provides an example-driven introduction to the latest language features and APIs in Java 6 and 7. Advanced Java developers will be able to take a deep dive into areas such as concurrency and JVM enhancements.

You’ll learn powerful new ways to manage resources and exceptions in your applications, and quickly get up to speed on Java’s new concurrency utilities, and APIs for web services and XML. You’ll also find an updated tutorial on how to get started with the Eclipse IDE, and a brand-new introduction to database access in Java.

Patrick Niemeyer

Patrick Niemeyer became involved with Oak (Java's predecessor) while working at Southwestern Bell Technology Resources. He is an independent consultant and author in the areas of networking and distributed applications. Pat is the author of BeanShell, a popular Java scripting language, as well as various other free goodies on the Net. Most recently, Pat has been developing enterprise architecture for A.G. Edwards. He currently lives in the Central West End area of St. Louis with various creatures.

Daniel Leuck

Dan Leuck is the CEO of Ikayzo, a Tokyo and Honolulu-based interactive design and software development firm with customers including Sony, Oracle, Nomura, PIMCO and the federal government. He previously served as Senior Vice President of Research and Development for Tokyo-based ValueCommerce, Asia's largest online marketing company, Global Head of Development for London-based LastMinute.com, Europe's largest B2C website, and President of the US division of DML. Daniel has extensive experience managing teams of 150+ developers in five countries. He has served on numerous advisory boards and panels for companies such as Macromedia and Sun Microsystems. Daniel is active in the Java community, is a contributor to BeanShell, the project lead for SDL, and sits on numerous Java Community Process expert groups.

  1. Chapter 1: A Modern Language

    1. Enter Java

    2. A Virtual Machine

    3. Java Compared with Other Languages

    4. Safety of Design

    5. Safety of Implementation

    6. Application and User-Level Security

    7. A Java Road Map

  2. Chapter 2: A First Application

    1. Java Tools and Environment

    2. Configuring Eclipse and Creating a Project

    3. HelloJava

    4. HelloJava2: The Sequel

    5. HelloJava3: The Button Strikes!

    6. HelloJava4: Netscape’s Revenge

  3. Chapter 3: Tools of the Trade

    1. JDK Environment

    2. The Java VM

    3. Running Java Applications

    4. The Classpath

    5. The Java Compiler

    6. JAR Files

    7. Policy Files

  4. Chapter 4: The Java Language

    1. Text Encoding

    2. Comments

    3. Types

    4. Statements and Expressions

    5. Exceptions

    6. Assertions

    7. Arrays

  5. Chapter 5: Objects in Java

    1. Classes

    2. Methods

    3. Object Creation

    4. Object Destruction

    5. Enumerations

  6. Chapter 6: Relationships Among Classes

    1. Subclassing and Inheritance

    2. Interfaces

    3. Packages and Compilation Units

    4. Visibility of Variables and Methods

    5. Arrays and the Class Hierarchy

    6. Inner Classes

  7. Chapter 7: Working with Objects and Classes

    1. The Object Class

    2. The Class Class

    3. Reflection

    4. Annotations

  8. Chapter 8: Generics

    1. Containers: Building a Better Mousetrap

    2. Enter Generics

    3. “There Is No Spoon”

    4. Parameterized Type Relationships

    5. Casts

    6. Writing Generic Classes

    7. Bounds

    8. Wildcards

    9. Generic Methods

    10. Arrays of Parameterized Types

    11. Case Study: The Enum Class

    12. Case Study: The sort() Method

    13. Conclusion

  9. Chapter 9: Threads

    1. Introducing Threads

    2. Threading an Applet

    3. Synchronization

    4. Scheduling and Priority

    5. Thread Groups

    6. Thread Performance

    7. Concurrency Utilities

    8. Conclusion

  10. Chapter 10: Working with Text

    1. Text-Related APIs

    2. Strings

    3. Internationalization

    4. Parsing and Formatting Text

    5. Printf-Style Formatting

    6. Formatting with the java.text Package

    7. Regular Expressions

  11. Chapter 11: Core Utilities

    1. Math Utilities

    2. Dates and Times

    3. Timers

    4. Collections

    5. Properties

    6. The Preferences API

    7. The Logging API

    8. Observers and Observables

  12. Chapter 12: Input/Output Facilities

    1. Streams

    2. File I/O

    3. The NIO File API

    4. Serialization

    5. Data Compression

    6. The NIO Package

  13. Chapter 13: Network Programming

    1. Sockets

    2. Datagram Sockets

    3. Simple Serialized Object Protocols

    4. Remote Method Invocation

    5. Scalable I/O with NIO

  14. Chapter 14: Programming for the Web

    1. Uniform Resource Locators (URLs)

    2. The URL Class

    3. Talking to Web Applications

    4. Web Services

  15. Chapter 15: Web Applications and Web Services

    1. Web Application Technologies

    2. Java Web Applications

    3. WAR Files and Deployment

    4. Servlet Filters

    5. Building WAR Files with Ant

    6. Implementing Web Services

    7. Conclusion

  16. Chapter 16: Swing

    1. Components

    2. Events

    3. Event Summary

    4. The AWT Robot!

    5. Multithreading in Swing

  17. Chapter 17: Using Swing Components

    1. Buttons and Labels

    2. Checkboxes and Radio Buttons

    3. Lists and Combo Boxes

    4. The Spinner

    5. Borders

    6. Menus

    7. Pop-Up Menus

    8. The JScrollPane Class

    9. The JSplitPane Class

    10. The JTabbedPane Class

    11. Scrollbars and Sliders

    12. Dialogs

  18. Chapter 18: More Swing Components

    1. Text Components

    2. Focus Navigation

    3. Tables

    4. Desktops

    5. Pluggable Look-and-Feel

    6. Creating Custom Components

  19. Chapter 19: Layout Managers

    1. FlowLayout

    2. GridLayout

    3. BorderLayout

    4. BoxLayout

    5. CardLayout

    6. GridBagLayout

    7. Other Layout Managers

    8. Absolute Positioning

  20. Chapter 20: Drawing with the 2D API

    1. The Big Picture

    2. The Rendering Pipeline

    3. A Quick Tour of Java 2D

    4. Filling Shapes

    5. Stroking Shape Outlines

    6. Using Fonts

    7. Displaying Images

    8. Drawing Techniques

    9. Printing

  21. Chapter 21: Working with Images and Other Media

    1. Loading Images

    2. Producing Image Data

    3. Filtering Image Data

    4. Saving Image Data

    5. Simple Audio

    6. Java Media Framework

  22. Chapter 22: JavaBeans

    1. What’s a Bean?

    2. The NetBeans IDE

    3. Properties and Customizers

    4. Event Hookups and Adapters

    5. Binding Properties

    6. Building Beans

    7. Limitations of Visual Design

    8. Serialization Versus Code Generation

    9. Customizing with BeanInfo

    10. Handcoding with Beans

    11. BeanContext and BeanContextServices

    12. The Java Activation Framework

    13. Enterprise JavaBeans and POJO-Based Enterprise Frameworks

  23. Chapter 23: Applets

    1. The Politics of Browser-Based Applications

    2. Applet Support and the Java Plug-in

    3. The JApplet Class

    4. Java Web Start

    5. Conclusion

  24. Chapter 24: XML

    1. The Butler Did It

    2. A Bit of Background

    3. XML Basics

    4. SAX

    5. DOM

    6. XPath

    7. XInclude

    8. Validating Documents

    9. JAXB Code Binding and Generation

    10. Transforming Documents with XSL/XSLT

    11. Web Services

    12. The End of the Book

  25. Appendix : The Eclipse IDE

    1. The IDE Wars

    2. Getting Started with Eclipse

    3. Using Eclipse

    4. Eclipse Features

    5. Conclusion

  26. Appendix : BeanShell: Java Scripting

    1. Running BeanShell

    2. Java Statements and Expressions

    3. BeanShell Commands

    4. Scripted Methods and Objects

    5. Changing the Classpath

    6. Learning More . . .

  27. Glossary

  28. Colophon