Geertjan is a DZone Zone Leader and has posted 453 posts at DZone. You can read more from them at their website. View Full User Profile

Beginning Java SE 6 Platform: From Novice to Professional

  • submit to reddit
Published by: Apress
ISBN: 159059830X

Reviewer Ratings




Buy it now

One Minute Bottom Line

Complete overview of all the goodies that Java SE 6 provides. Very well explained, just enough on everything, often in quite some detail with many juicy code samples.


Chapter 1: Introducing Java SE 6. Covers the main themes of the release: "Compatibility and stability", "Diagnosability, monitoring, and management", "Ease of development", "Enterprise desktop", "XML and web services", and "Transparency". A sampling of Java SE 6's distinguishing features is covered in this chapter, on a very detailed level, with code samples, such as the Image I/O GIF writer plug-in. It is very cool that there are references to various blog entries here, such as to Scott Violet's blog and Cay Horstmann's blog. This chapter also outlines all the JSRs that relate to Java SE 6, within the umbrella JSR, which is JSR 270. The "Test Your Understanding" section includes the question: "Why should you create a Swing program's GUI only on the event-dispatching thread?", which is also covered in this chapter.

Chapter 2: Core Libraries. The enhancements to libraries (BitSet class, for example) and the new APIs (Compiler API and ServiceLoader API), as well as other library enhancements (new/improved collections, concurrency) are discussed. For example, you'll learn how the improved File class provides new methods that let you determine the amount of free disk space and a file's permissions. One of the "Test Your Understanding" questions is: "Use a copyOf() method to copy an array of Strings to a new CharSequence Array."

Chapter 3: GUI Toolkits: AWT. Here the new Desktop, Splash Screen, and System Tray APIs are discussed, together with the modality model and infrastructural improvements. I like how application specific splash screens can be set in a Manifest file. Pretty cool and handy, bringing Swing framework-like features to standard Swing applications. The system tray code is completely outlined, very nice. Do you know how to launch a program quickly via the system tray? This chapter provides all the code.

Chapter 4: GUI Toolkits: Swing. Improvements to Swing! JTabbedPane, SpringLayout layout manager, drag/drop, JTable class, enhancements to look and feel, and the SwingWorker class. "What does indexOfTabComponent() return if tab is not associated with it Component argument?"is one of the "Test Your Understanding" questions. Do you know? If not, you know where to go to find out...

Chapter 5: Internationalization. Calendar class, locale-sensitive services, Normalizer API, and ResourceBundle enhancements (eight new methods added to the ResourceBundle class). New locales, such as in_ID for Indonesia/Indosian, have been added, which is interesting.

Chapter 6: Java Database Connectivity. New JDBC features such as automatic driver loading to wrapper pattern support. Java DB is discussed in some detail, which is the pure-Java DBMS bundled with JDK 6. The intro to Java DB, from installation to working with it, is great. The "Test Your Understanding" section suggests some extension tasks, that relate to MySQL, which is pretty cool, so that you can apply what you've learned to a different DBMS, which is especially interesting now in light of Sun's recent acquisition.

Chapter 7: Monitoring and Management. Dynamic attach and the new Attach API, which is applicable to JConsole and its interactions with JMX. The improved JConsole GUI is discussed too, as well as JConsole plugins and the JConsole API. Instrumentation API, JVM Tool interface, Management and JMX APIs. One area that's piqued my interest here is the JConsole plugin discussion, which I didn't know about. Full code for a basic plugin is provided here, for adding a new tab to JConsole.

Chapter 8: Networking. Here we learn that Java SE 5's CookieHandler class has been enhanced with the CookieManager class, for listenting to a website's cookies. Internationalized domain names, network parameters, and the new lightweight HTTP server/API are discussed. I particularly like the section on the lightweight HTTP server, for its clarity and concise explanations. I also like the teasers that the first chapter provides to this chapter, for example: "Developers of networked games will find one of the new network parameter methods described in this chapter especially helpful." The chapter picks up from earlier discussions, by adding internationalized domain names to the web browser created in chapter 4. Pretty cool that Java SE 6 features discussed in one chapter are extended in another.

Chapter 9: Scripting. The Scripting API and experimental jrunscript tool are introduced. JRuby and JavaFX, from the Scripting API perspective, are discussed here. An interesting example, with all code provided, shows how to integrate JavaScript into an editor pane via the Scripting API, in order to give dynamic colors to a web page open in the editor pane. Here the code covers about 5 pages, but is beauitfully indented and spaced, making for easy reading, with some lines boldened to highlight something discussed in the chapter or to delineate methods. Java FX and the OpenJFX project are discussed at the end of this chapter, together with the code of an illustrative sample.

Chapter 10: Security and Web Services. Two new security features, the Smart Card I/O and XML Digital Signature APIs are covered. A small code sample is provided that shows how to obtain the default terminal factory and a factory for the PC/SC stack, which is a nice entrypoint to the API. For the other API, an example is discussed that shows capabilities for signing an XML document and validating its signature. Also discussed are new support for web services, via a web services stack and various tools. The JDK's new web services stack (classes such as javax.jws.WebService) lets you create and locally test web services and access existing web services, via the new lightweight HTTP server discussed earlier. It's cool how the chapter begins by pointing you to various online articles, for if you're new to web services.

Appendix A: New Annotation Types. Great! Tables and tables listing the new annotation types. A complete reference, such as the web services annotations, like WebService and WebMethod.

Appendix B: New and Improved Tools. Outlines improvements to tools like the Java archivist and Java language compiler. Where applicable, pointers are provided to online resouces listing all the improvements in question, such as for Java Web Start.

Appendix C: Performance Enhancements. Single threaded rendering, better performance image I/O, faster JVM, and a fix for the gray-rect problem.

Appendix D: Test Your Understanding Answers. Answers to all the questions!

Appendix E: A Preview of Java SE 7. Looks forward and discussed upcoming discussed changes, such as Closures, JMX, scripting, superpackages, and, Swing Application Framework, and module system.

Published at DZone with permission of its author, Geertjan Wielenga.