Synopses & Reviews
Java is the preferred language for many of todays leading-edge technologies—everything from smartphones and game consoles to robots, massive enterprise systems, and supercomputers. If youre 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.
Youll learn powerful new ways to manage resources and exceptions in your applications, and quickly get up to speed on Javas new concurrency utilities, and APIs for web services and XML. Youll also find an updated tutorial on how to get started with the Eclipse IDE, and a brand-new introduction to database access in Java.
About the Author
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.
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.
Table of Contents
Preface; Who Should Read This Book; New Developments; Using This Book; Online Resources; Conventions Used in This Book; Using Code Examples; Safari® Books Online; How to Contact Us; Acknowledgments; Chapter 1: A Modern Language; 1.1 Enter Java; 1.2 A Virtual Machine; 1.3 Java Compared with Other Languages; 1.4 Safety of Design; 1.5 Safety of Implementation; 1.6 Application and User-Level Security; 1.7 A Java Road Map; Chapter 2: A First Application; 2.1 Java Tools and Environment; 2.2 Configuring Eclipse and Creating a Project; 2.3 HelloJava; 2.4 HelloJava2: The Sequel; 2.5 HelloJava3: The Button Strikes!; 2.6 HelloJava4: Netscape's Revenge; Chapter 3: Tools of the Trade; 3.1 JDK Environment; 3.2 The Java VM; 3.3 Running Java Applications; 3.4 The Classpath; 3.5 The Java Compiler; 3.6 JAR Files; 3.7 Policy Files; Chapter 4: The Java Language; 4.1 Text Encoding; 4.2 Comments; 4.3 Types; 4.4 Statements and Expressions; 4.5 Exceptions; 4.6 Assertions; 4.7 Arrays; Chapter 5: Objects in Java; 5.1 Classes; 5.2 Methods; 5.3 Object Creation; 5.4 Object Destruction; 5.5 Enumerations; Chapter 6: Relationships Among Classes; 6.1 Subclassing and Inheritance; 6.2 Interfaces; 6.3 Packages and Compilation Units; 6.4 Visibility of Variables and Methods; 6.5 Arrays and the Class Hierarchy; 6.6 Inner Classes; Chapter 7: Working with Objects and Classes; 7.1 The Object Class; 7.2 The Class Class; 7.3 Reflection; 7.4 Annotations; Chapter 8: Generics; 8.1 Containers: Building a Better Mousetrap; 8.2 Enter Generics; 8.3 "There Is No Spoon"; 8.4 Parameterized Type Relationships; 8.5 Casts; 8.6 Writing Generic Classes; 8.7 Bounds; 8.8 Wildcards; 8.9 Generic Methods; 8.10 Arrays of Parameterized Types; 8.11 Case Study: The Enum Class; 8.12 Case Study: The sort() Method; 8.13 Conclusion; Chapter 9: Threads; 9.1 Introducing Threads; 9.2 Threading an Applet; 9.3 Synchronization; 9.4 Scheduling and Priority; 9.5 Thread Groups; 9.6 Thread Performance; 9.7 Concurrency Utilities; 9.8 Conclusion; Chapter 10: Working with Text; 10.1 Text-Related APIs; 10.2 Strings; 10.3 Internationalization; 10.4 Parsing and Formatting Text; 10.5 Printf-Style Formatting; 10.6 Formatting with the java.text Package; 10.7 Regular Expressions; Chapter 11: Core Utilities; 11.1 Math Utilities; 11.2 Dates and Times; 11.3 Timers; 11.4 Collections; 11.5 Properties; 11.6 The Preferences API; 11.7 The Logging API; 11.8 Observers and Observables; Chapter 12: Input/Output Facilities; 12.1 Streams; 12.2 File I/O; 12.3 The NIO File API; 12.4 Serialization; 12.5 Data Compression; 12.6 The NIO Package; Chapter 13: Network Programming; 13.1 Sockets; 13.2 Datagram Sockets; 13.3 Simple Serialized Object Protocols; 13.4 Remote Method Invocation; 13.5 Scalable I/O with NIO; Chapter 14: Programming for the Web; 14.1 Uniform Resource Locators (URLs); 14.2 The URL Class; 14.3 Talking to Web Applications; 14.4 Web Services; Chapter 15: Web Applications and Web Services; 15.1 Web Application Technologies; 15.2 Java Web Applications; 15.3 WAR Files and Deployment; 15.4 Servlet Filters; 15.5 Building WAR Files with Ant; 15.6 Implementing Web Services; 15.7 Conclusion; Chapter 16: Swing; 16.1 Components; 16.2 Events; 16.3 Event Summary; 16.4 The AWT Robot!; 16.5 Multithreading in Swing; Chapter 17: Using Swing Components; 17.1 Buttons and Labels; 17.2 Checkboxes and Radio Buttons; 17.3 Lists and Combo Boxes; 17.4 The Spinner; 17.5 Borders; 17.6 Menus; 17.7 Pop-Up Menus; 17.8 The JScrollPane Class; 17.9 The JSplitPane Class; 17.10 The JTabbedPane Class; 17.11 Scrollbars and Sliders; 17.12 Dialogs; Chapter 18: More Swing Components; 18.1 Text Components; 18.2 Focus Navigation; 18.3 Tables; 18.4 Desktops; 18.5 Pluggable Look-and-Feel; 18.6 Creating Custom Components; Chapter 19: Layout Managers; 19.1 FlowLayout; 19.2 GridLayout; 19.3 BorderLayout; 19.4 BoxLayout; 19.5 CardLayout; 19.6 GridBagLayout; 19.7 Other Layout Managers; 19.8 Absolute Positioning; Chapter 20: Drawing with the 2D API; 20.1 The Big Picture; 20.2 The Rendering Pipeline; 20.3 A Quick Tour of Java 2D; 20.4 Filling Shapes; 20.5 Stroking Shape Outlines; 20.6 Using Fonts; 20.7 Displaying Images; 20.8 Drawing Techniques; 20.9 Printing; Chapter 21: Working with Images and Other Media; 21.1 Loading Images; 21.2 Producing Image Data; 21.3 Filtering Image Data; 21.4 Saving Image Data; 21.5 Simple Audio; 21.6 Java Media Framework; Chapter 22: JavaBeans; 22.1 What's a Bean?; 22.2 The NetBeans IDE; 22.3 Properties and Customizers; 22.4 Event Hookups and Adapters; 22.5 Binding Properties; 22.6 Building Beans; 22.7 Limitations of Visual Design; 22.8 Serialization Versus Code Generation; 22.9 Customizing with BeanInfo; 22.10 Handcoding with Beans; 22.11 BeanContext and BeanContextServices; 22.12 The Java Activation Framework; 22.13 Enterprise JavaBeans and POJO-Based Enterprise Frameworks; Chapter 23: Applets; 23.1 The Politics of Browser-Based Applications; 23.2 Applet Support and the Java Plug-in; 23.3 The JApplet Class; 23.4 Java Web Start; 23.5 Conclusion; Chapter 24: XML; 24.1 The Butler Did It; 24.2 A Bit of Background; 24.3 XML Basics; 24.4 SAX; 24.5 DOM; 24.6 XPath; 24.7 XInclude; 24.8 Validating Documents; 24.9 JAXB Code Binding and Generation; 24.10 Transforming Documents with XSL/XSLT; 24.11 Web Services; 24.12 The End of the Book; The Eclipse IDE; The IDE Wars; Getting Started with Eclipse; Using Eclipse; Eclipse Features; Conclusion; BeanShell: Java Scripting; Running BeanShell; Java Statements and Expressions; BeanShell Commands; Scripted Methods and Objects; Changing the Classpath; Learning More . . .; Glossary; Colophon;