Rich Client Programming: Plugging into the NetBeans Platform 1 PAP/CDRst Edition
| Tim Boudreau (Author) Find all the books, read about the author, and more. See search results for this author |
| Jaroslav Tulach (Author) Find all the books, read about the author, and more. See search results for this author |
Use the Amazon App to scan ISBNs and compare prices.
The open-source NetBeans Platform is an extraordinarily powerful framework for building "write once, run anywhere" rich client applications. Now, for the first time since the release of NetBeans IDE 5.0, there's a comprehensive guide to rich client development on the NetBeans Platform.
Written for Java developers and architects who have discovered that basic Swing components are not enough for them, this book will help you get started with NetBeans module development, master NetBeans' key APIs, and learn proven techniques for building reliable desktop software. Each chapter is filled with practical, step-by-step instructions for creating complete rich client applications on top of the NetBeans Platform and plugins for NetBeans IDE.
Rich Client Programming's wide-ranging content covers
- Why modular development makes sense for small, medium, and large applications
- Using NetBeans to accelerate development and improve efficiency
- Leveraging NetBeans productivity features, from the Component Palette to Code Completion
- Leveraging NetBeans' modular architecture in your own applications
- Implementing loosely coupled communication to improve code maintainability and robustness
- Managing user- and system-configuration data
- Building reloadable components with solid threading models
- Constructing sophisticated multiwindow applications and presenting rich data structures to users
- Adding user-configurable options
- Integrating Web services with NetBeans desktop applications
- Automating module updates and providing user help
Foreword by Jan Chalupa
Preface
About the Authors and Contributors
Acknowledgments
Chapter 1: Getting Started with the NetBeans Platform
Chapter 2: The Benefits of Modular Programming
Chapter 3: Modular Architecture
Chapter 4: Loosely Coupled Communication
Chapter 5: Lookup
Chapter 6: Filesystems
Chapter 7: Threading, Listener Patterns, and MIME Lookup
Chapter 8: The Window System
Chapter 9: Nodes, Explorer Views, Actions, and Presenters
Chapter 10: DataObjects and DataLoaders
Chapter 11: Graphical User Interfaces
Chapter 12: Multiview Editors
Chapter 13: Syntax Highlighting
Chapter 14: Code Completion
Chapter 15: Component Palettes
Chapter 16: Hyperlinks
Chapter 17: Annotations
Chapter 18: Options Windows
Chapter 19: Web Frameworks
Chapter 20: Web Services
Chapter 21: JavaHelp Documentation
Chapter 22 Update Centers
Chapter 23: Use Case 1: NetBeans Module Development
Chapter 24: Use Case 2: Rich Unger on Application Development
Chapter A: Advanced Module System Techniques
Chapter B: Common Idioms and Code Patterns in NetBeans
Chapter C: Performance
Index
Editorial Reviews
About the Author
Tim Boudreau coauthored NetBeans: The Definitive Guide (O'Reilly), served on the team that open-sourced NetBeans, and continues to develop for the NetBeans project.
Jaroslav Tulach cofounded the NetBeans project, and remains a leading guardian of the project API.
Geertjan Wielenga is the technical writer responsible for NetBeans documentation relating to module development and rich-client application development.
Excerpt. © Reprinted by permission. All rights reserved.
Welcome to the world of rich client development on the NetBeans Platform.
Though the Internet boom pushed much programming effort to the server side, the demand for quality desktop software remains and is arguably increasing. Some of the reasons include
- Web pages, which are generally the interfaces for server-driven applications, often are insufficient for the needs of the end user.
- Not every application requires a constant Internet connection, and some applications need to function offline.
In this book, we will focus on using the NetBeans Platform as a framework for creating rich client applications that can be written once and then run on any operating system. The NetBeans Platform is the foundation of the NetBeans IDE, which helpshundreds of thousands of programmers develop applications of all sizes and complexity. As such, the platform is a very powerful and robust base that you can use for your own applications, whether they are commercial applications or in-house solutions. In addition, we will show you what you need to know to create modules to plug into the NetBeans IDE itself.
Rich Client Applications
What do we mean by the term rich client application? A rich client application is simply a piece of software where a good portion, if not all, of the application's features work on the user's local system. This is in contrast with a Web application, where the features are entirely dependent on code that is run from a remote server and (usually) accessed by the user through a Web browser. More or less, the term rich client is a fancy new moniker for "desktop application." For example, NetBeans IDE itself is a rich client application.
What Is NetBeans?
NetBeans is best known as a popular and award-winning integrated development environment (IDE) for developing Java applications. At the IDE's core is the NetBeans Platform, a modular and extensible application framework. The IDE is a well-orchestrated combination of the platform and a vast array of modules.
At a very early stage in the history of the IDE, the IDE's architecture was modularized to make development of the IDE more flexible. The IDE's modular
- It simplifies the creation of new features.
- It makes it easy for users to add and remove features.
- It makes it easy to update existing features in a user's installation without disrupting the rest of the application.
The modularity of the NetBeans Platform has made it very attractive to software developers around the world, who have created a large number of different applications on top of it. The NetBeans IDE is the most well-known of those, but the NetBeans Platform has been used as the basis for applications in many domains, from speech processing to geological mapping to stock trading.
Why NetBeans?
There are many reasons to build NetBeans Platform-based applications, not the least of which is the fact that NetBeans-based applications are truly cross-platform. It is possible to develop cross-platform rich client applications in a variety of ways. For example, you can use Swing components and write all of the plumbing of a desktop application yourself. Using the NetBeans Platform, however, gives you powerful building blocks and back-end infrastructure that your applications need, so that you do not have to code those parts yourself. This can save you a significant amount of time. You add the Swing components to the NetBeans Platform that are needed for your application logic, and optionally use other libraries such as JGraph, JFreeChart, etc. So, overall, NetBeans has a great deal to offer when it comes to rapid development of robust and scalable applications. You can focus on the essentials that are specific to your application. Put another way, the NetBeans Platform isto Swing development what JavaServer Faces technology and Struts are to Web development.
The following are some of most important benefits of the NetBeans Platform:
- NetBeans is free and its code is freely reusable, whether you are developing commercial or noncommercial software.
- NetBeans is a mature and feature-rich application framework. The components of the NetBeans Platform have been developed to serve the needs of the NetBeans IDE, an application that is used by hundreds of thousands of demanding software engineers---yet they are optimized for the production ofany sort of desktop application, not just IDEs or IDE-like applications. With the NetBeans Platform, you have a great basis for a production-quality application.
- NetBeans is truly a "write once, run anywhere" platform. NetBeans is based on Swing, the pure-Java visual toolkit which is part of every desktop Java installation.
- NetBeans technology is standards-based and open source, which means that you will never be a victim of proprietary lock-in when developing on the platform.
- Plugins for NetBeans IDE have a massive potential audience. If you are looking to showcase your own technologies, creating a plugin module for NetBeans IDE and making it available through the NetBeans Plugin Portal (http://plugins.netbeans.org/PluginPortal) is a great way to reach a wide audience of developers.
- NetBeans has a vibrant developer community. The NetBeans Platform benefits from a strong community of developers who are eager to share their experiences. If you have questions about a particular problem, chances are that someone will have had the same issue and will be able to help you.
What Does the Platform Provide for Me as an Application Developer?
When you develop on the NetBeans Platform, you get a rich set of base features, extensive APIs with which you can create your own features, and a powerful set of tools to help you in development.
The following are some of the most important things that you get when you start programming on the NetBeans Platform:
- A Window System that greatly simplifies the manipulation of multiple components within a single frame.
- An Actions system that makes it easy to declaratively install and uninstall menu items, toolbar items, keyboard shortcuts, etc.
- The Auto Update mechanism, which provides a way to dynamically update a user's installation of your application.
- The whole range of NetBeans IDE features that simplify application development, such as code completion and an advanced GUI builder (formerly code-named Matisse), in which you can visually design your user interfaces by dragging, dropping, and rearranging components.In addition, you get special module-development features such as module templates and the ability to test modules on the fly by installing or reloading them into the currently running IDE.
- The architecture of your application is likely to become more robust when using the modular coding techniques encouraged by the NetBeans Platform.
Why This Book?
With the increasing popularity of the IDE and the recognition of the platform's convenience for creating the basics of any application, a book is sorely needed. Much information about the NetBeans Platform is already available, but there is no single up-to-date source that demonstrates how to make use of the whole platform. This book pulls together years' worth of accumulated wisdom, best practices, and practical information,and presents it all in one place.
This book will get you started quickly with module development and guide you through the most important APIs. Along the way, you will learn some of the programming practices that have made NetBeans such reliable and scalable software.
How to Use This Book
This book is divided into twenty-two chapters, two use cases, and three appendices.
- Chapter 1 gets you set up and shows the basic process of creating a module.
- Chapters 2 and 3 discuss the benefits of modularity and provide an overview of the modular structure of the NetBeans Platform.
- Chapters 4 and 5 explain the concepts behind the way NetBeans modules work together and show you the platform's mechanisms for making modular applications cohesive.
- Chapter 6 introduces you to the Filesystems API, which is the NetBeans Platform's base construct for handling both user data and system configuration data.
- Chapter 7 consolidates information from previous chapters and shows you how to create a simple Navigator component for the platform.
- Chapter 8 explains and demonstrates the NetBeans building blocks and features for creating mature multiwindow applications.
- Chapter 9 shows you the Nodes and Explorer APIs, which give you rich ways to present data structures to users.
- Chapter 10 highlights the Datasystems API, which gives you ways to easily programmatically manipulate files of a given type.
- Chapter 11 shows off the IDE's GUI Builder and how it simplifies developing user interfaces for NetBeans Platform applications.
- Chapter 12 builds upon the previous chapters and shows you how to provide multiple types of representations of a file's contents.
- Chpaters 13 and 14 show you ways to add editing features for a file type.
- Chapter 15 explains how to create a palette of objects and provides an example for enabling drag-and-drop of code snippets from the palette to a text editor.
- Chapters 16 and 17 show how to develop more editing features.
- Chapter 18 shows you how to add user-configurable options to your application.
- Chapter 19, using Wicket as an example, shows how you can create IDE support for a Web application framework.
- Chapter 20 shows how you can use Web services with a NetBeans Platform application.
- Chapter 21 demonstrates how to integrate help documentation into your application.
- Chapter 22 shows you how to make updates of your modules (and totally new modules) available to users in a dynamic update center.
- The two final chapters are use cases presented by users of the NetBeans Platform. In Chapter 23, you get an example of integrating an existing developer tool into the IDE. In Chapter 24, you can see an example of creating a specialized desktop application, in this case for editing audio files.
- The appendices provide extra information that you might find useful for optimizing the robustness, readability, scalability, and performance of your code.
This book does not cover the features of the IDE so much as the APIs that make those features possible. If you are interested in using the IDE for development of standard Swing, Web, enterprise, mobile, and other Java applications, there are a number of other excellent resources available, such as the NetBeans™ IDE Field Guide (also available from Prentice Hall) and the documentation available in the product and on the www.netbeans.org and http://wiki.netbeans.org Web sites.
No tutorial is a complete substitute for reference documentation, and this book is no exception. Full documentation for NetBeans APIs can be found on the NetBeans Platform Web site or downloaded directly into the IDE from the Update Center. The Developer FAQs are a good resource for getting answers to both eternal and newly arising frequent questions. The NetBeans mailing lists, particularly the dev@openide.netbeans.org mailing list, are invaluable for getting answers to less frequently arising questions. If you are going to develop modules, we strongly encourage you to sign up for this list. Through it, you can reach the entire NetBeans development team and extended community, including the authors of this book.
Before beginning to develop NetBeans modules, it is worthwhile to check the Update Center (on the Tools menu) and make sure you have the latest version of the NetBeans module development tools. These tools contain templates and other special support to simplify module development.
Staying Up-to-Date
Check the home page for this book for updates and extra content.
This book is written to version 5.5 of the NetBeans Platform, which is currently the most recent release. Future versions of the platform will surely follow. Version 6.0 is currently in progress and will be final later in 2007. Though information in this book will be valuable for version 6.0 and well into the future, you will probably still find it worthwhile to check the Upgrade Guide to find out about any API changes, improvements, and deprecations occurring after 5.5. Where we know about changes for 6.0, we have noted them.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.
Product details
- Publisher : Prentice Hall; 1st edition (April 30, 2007)
- Language : English
- Paperback : 604 pages
- ISBN-10 : 0132354802
- ISBN-13 : 978-0132354806
- Item Weight : 2 pounds
- Dimensions : 7 x 1.25 x 9 inches
- Best Sellers Rank: #6,301,658 in Books (See Top 100 in Books)
- #1,258 in Client-Server Networking Systems
- #3,493 in Java Programming
- #13,774 in Computer Programming Languages
- Customer Reviews:
About the authors

My name is Jaroslav Tulach and I am the founder and initial architect of NetBeans, which is not just a well known IDE, but also the first modular desktop application framework written in Java. My name sounds Slavic and has a strange pronunciation (read the initial J as Y and last ch as in Scottish loch or in German Bach), because I am Czech. However, as NetBeans has been the flagship software product of Sun Microsystems/Oracle for a while now, you don't have to worry that content of my Practical API Design book might not be widely applicable and understandable.

Discover more of the author’s books, see similar authors, read author blogs and more
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonTop reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Some of the concepts take a little getting used to, such as the Lookup API, but once you get it, it makes sense.
I love all the documentation online, but there is no substitute for the Rich Client Programming book. The other books are good too (I always buy anything I can get my hands on for a new subject), but if I had just one book for Netbeans it would be the Rich Client Programming.
So what we have here is a book written about a technology by the people who created that technology. The worry for readers is there will not be enough editorial pushback against the experts to clarify their language; if they say "that's right" about something they wrote, then who is going to argue with them?
Unfortunately, that fear is well founded in this case. For instance, after a lengthy and rather abstract "manifesto" type chapter (chapter 4) on the (uncontroversial) benefits of modular applications and decoupling of abstraction from implementation, they introduce something called Lookup, which is, basically, a little database of keys and values, or, even more roughly, a "magic bag" of keys and values. Leaving aside the issue of whether Lookup is a Good Idea or not, the authors fail utterly in their illustrations of how and why Lookup is used to actually clarify its usage or purpose. The examples meant to clarify Lookup in Chapter 5 fail every test of good writing- they're chock full of references to Netbeans-specific classes and Netbeans-specific idioms that the reader could not possibly understand, unless of course the reader already understood the Netbeans framework, in which case, the chapter itself would presumably be moot. This is exactly the kind of thing a good editor should have caught.
Generally, the good point of this book is its written by the people closest to the technology, and is in that sense authoritative. The bad points are that such people are often terrifically bad at identifying what it is they understand that their readers don't, and crossing that chasm. The overall effect is, the authors sound didactic and overly repetitive, e.g. chapter 4, when they have a philosophical / architectural point they want to argue; they find too many ways to say simple things over and over.
On the other hand, when it comes to explaining the nuts and bolts of Netbeans, while they do give a good broad overview of its "parts", the more exacting task of transmitting clarifying details coherently, such that the reader could say after they've read the passage, "there, all that earlier abstract talk has been made concrete by a clear and forceful example, and I understand the technology,", well, that's the hard part of writing a book, and there they fail quite miserably.
Its get a star for its topic and another for its timeliness.
