21 internautes sur 21 ont trouvé ce commentaire utile
- Publié sur Amazon.com
Java Swing is the definitive reference for the Graphical User Interface (GUI) Swing package that has been included in the standard distribution of the Java SDK since Java 1.2. The book is really more of a tomb, weighing in at 1200 pages, and yet none of it seems irrelevant or overly explained. If anything, one would have to complain that maybe there are details missing, but given the length of the book as is, maybe it's better that some of the details were left out.
Publishers O'Reilly have obviously assembled a group of talented Java GUI designers to write this book, because the commentary is rife with real advice and coherent, practical explanations. The book does take some assumed knowledge for granted, such as basic programming skills, knowledge of Object-Oriented programming practices, and UML-style class and object relationship graphs, but I wouldn't say that this book excludes the beginner programmer in the least. Instead, it walks the fine line of being a useful book for both beginner and expert coders quite well, better than other O'Reilly publications that I've read in the past that I felt were overly explanatory.
The book starts off with a little history on the Swing package, where it came from and what its relationship to the Abstract Windowing Toolkit (AWT) is, but then almost immediately launches into the format that it uses for the next 900 pages of the book, which is to devote an entire chapter to every major section of swing. Topics covered include: buttons, scrollbar-like components, combo-boxes, containers of every shape and size, dialogs, borders, menus, tables, trees, undo facilities, text (about 220 pages on the major text components alone,) and drag and drop. Each of these sections serves as a useful reference for when you're developing your own GUI applications. The explanations are generally more details and much deeper than those offered in the Javadoc HTML pages provided with the SDK distribution. I've personally used the book on a couple of projects that I've been working on at work, and found that the background given has been incredibly useful, not just for solving problems but for generating ideas for how things could be better. The topic separation is such that you can usually just read the chapter that deals with what you are currently doing, and not have to jump around the book looking for better explanations of the same idea. There is very little overlap in this book, which I consider to be a good thing in a reference book. The final four chapters deal with advanced topics, and a genuinely insightful and useful.
Now for the minor complaints: This book is truly focused on Swing, but sometimes I felt that the focus was just a little too narrow. Mainly my issues come from the authors deciding that AWT is a separate topic from Swing. Thus, any discussions of GUI programming elements that fall under the canvas of AWT are ignored. This is unfortunate, since real-life GUI applications have no choice but to use AWT elements. What's even more unfortunate is that Swing, being built on top of AWT, relies heavily on its architecture. JComponent, the root class of 95% of Swing component, is itself derived from Container and Component, the root classes of AWT. Browsing the O'Reilly catalogue, I failed to notice a book devoted to AWT, though I think it used to exist but has since been discontinued. This leaves me wondering where a GUI programmer should go to get the details needed to do the job. The most obvious omission in my eyes - apart from a discussion of Component and Container - is the failure to properly outline the common LayoutManagers available in Swing. Layout management is a crucial task for GUI programmers, and yet the only mention of them are the new LayoutManagers introduced by Swing. These new managers, however, by no means replace the old AWT managers that are the bread and butter of GUI programming.
My other minor complaint is that the book is cumbersome. This makes it a chore to use, though I fully admit that this is a very minor problem. However, I would have preferred that the publishers ship the book as a two-book set and charged a bit more for it.
Negatives aside, this book is a must-have for Java Swing programmers. The book isn't perfect, but I haven't come across a better reference for the topic.