Slashdot Log In
Swing
from the more-swinging-with-java dept.
| Swing | |
| author | Matthew Robinson and Pavel Vorobiev |
| pages | 917 |
| publisher | Manning Publications, 08/1999 |
| rating | 10/10 |
| reviewer | Jayakrishnan (JK) |
| ISBN | 1884777848 |
| summary | Unique examples and the exhaustive coverage of Swing make this a valuable book for both beginners and advanced programmers. |
How many times have you opened a book in search of a solution and found not only an answer, but also an elegant enhancement to your application? How many times have you ignored an O'Reilly book on the same subject lying on your table? The answer is Manning's new book Swing authored by Mathew Robinson and Pavel Vorobiev. And that is my final answer.
The book (with just a 5-character title) is 917 pages long and is divided into four parts containing 23 chapters, an appendix and a bibliography. The first part, "Foundations," introduces Swing, its architecture and the key mechanism underlying Swing. Part II, mysteriously called "The Basics," explains the most commonly used and simpler classes of the Swing toolkit like labels, buttons, menus, list boxes, progress bars and sliders. The third part of the book, "Advanced topics," deals with using complicated components like trees, tables, text components and layered panes, as well as creating pluggable look and feel. The final part, "Special topics" introduces printing and the Java2D API.
Only two chapters of the final part are included in the book. The remaining four chapters which discuss accessibility, JavaHelp API, CORBA and some examples contributed by experienced Swing developers are available on the book's Web site.
The structure of each chapter is the same. Let's look at the chapter on tables as an example. The JTable class is introduced followed by related classes and interfaces. This is followed by discussions on row and column selections from JTable, column width and resizing and customizing the appearance of the table. The important methods related to these issues are discussed and short code samples are used to demonstrate the main features.
Then comes the meat of the chapter -- the examples. The first example shows how to display stock market data in a JTable. Complete code for the example is given and important sections are discussed. The examples that follow are enhancements to the first example. In the JTable chapter, they include adding custom renderers, customizing the data rendering, retrieving and displaying data from a database.
Each of the examples builds upon the previous one and as promised on the cover of the book, is production-quality code. While most other Swing books serve as expensive javadoc dumps of JFC with trivial, forgettable examples, Swing provides code that saves lots of time for the developer. The other applications that are developed in the book include a JPEG image editor, an ftp client, an X-Window-style desktop environment and a word processor.
This book is for the developer building applications using the Swing components of the Java Foundation Classes. The large number of examples make this a great cookbook providing code samples that will vastly reduce your development time. The language is simple and the examples are well defined. All the Swing components are discussed in detail with several screen shots.
The part I liked the most in this book is the section in each chapter about extending the Swing components to create custom components. These include creating an oval shaped border, polygonal buttons, and a tabbed pane which takes an image as the background. These examples provide knowledge to extend the components in ways limited only by your imagination.
The book is sprinkled with UI design guidelines by David Anderson related to usability and presentation. There is no reference to the Java Look and Feel Design Guidelines issued by JavaSoft. So I would recommend referring to that book (published by Sun Microsystems) if you want to design applications with consistent appearance and behavior.
The only minor annoyances in this book are the figures which display the component hierarchy, as they have an unprofessional look. But there are only a few of them.
To summarize, the unique examples and the exhaustive coverage of Swing makes this book very valuable for both beginners and advanced programmers.
Purchase this book at ThinkGeek.

Re:claims != reality (Score:3)
Its popular Developer tool also deploys all of its former platform-specific client-server apps to the web via Java with a recompile, and that's got lots of customers using it.
Fact is, Java is widely used for applications staged in corporate intranets. Just because you aren't using applets as you troll sites like Slashdot doesn't mean you have any grasp on "reality".
Re:Hasn't Java had its day? (Score:3)
Umm, websites that use Java, thats a tough one, after all CGI is such a scalable tool... http://java.sun.com long shot that one... http://www.clip2.com/ is another one, and the list goes on.
Java is far from a dead language but many people see it as being it or CGI. It isn't Java is an _application_ language. Projects I have worked on have tended to have very thin client sides with Java running on a big piece of iron out back.
Java is far from dead, HTTP and Web-browsers however are a very poor means of communication and IMO will probably die in the next few years.
For cool toys in Java go to http://www.alphaworks.ibm.com
In summary Java is a commercial application language that makes it simpler (its no silver bullet mind) to develop larger scale projects and deploy in a number of enviroments.
Java in Industry. (Score:3)
Off the top of my head, let me see Mail.com uses Java to serve its pages [netcraft.com]. Does Oracle's new Enterprise database [oracle.com] count?
And from Sun's page of industry news, we have companies like RSA, Oracle, Netcom, SAAB, Delta Air etc. using Java in mission critical situations on a daily basis. [sun.com]
Posts like this make me wonder about who composes slashdot's readership. Because only script kiddies and so-called web developers (HTML and javascript kiddies) use Java as a web app language. Also no one in his right mind uses Java for GUI development if the application has any degree of complexity. But as a middleware development language it is practically untouchable. When it comes to speed of development, maintainability and expandability for business applications few things beat Java. Add a native GUI or web interface depending on your application and a rock solid app has been created.
PS: Myth dispel mode Oh yeah, by the way Java pages are faster or at the very least as fast as CGI, it has to do with being memory resident a la the VM as opposed to being read from disk. Here's a benchmark [mindcraft.com] and a link [aspect.com.au] or two [scu.edu.au].
Re:Hasn't Java had its day? (Score:3)
I would even consider using it and what the hell. Learning this is NOT so bad actually, all of the concepts play with C++ ways of thinking so well.. so you are maybe at a loss of a couple of months of good studying at worst if you learn this. I know that is a lot of time for some.. But I dont think its gonna 'crash' and burn on a resume.
The thinking is much like C++ and If you aren an OO guy aching for a decent RAD language that has reasonable sane syntax and all the fun reusability of OO Java is it, and java is backed by a big company, there is even a microsoft product for it. Java was a LOT of hype, now that its calmed down I am seeing it does have a place and I happen to like this place
I dont know how much most people have noticed but lots and lots of VB shops (one I contract for included) are turning to Java just for windows platform because its a lot more sane than VB. This is kind of cool since it means these apps can migrate to Linux nearly painlessly.. Fight it all we want business is a factor in the computer industry and many application shops are looking to Java for a solution. Best to not get caught with yer pants down
Jeremy
Re:Is Anybody Really Using Java? (Honestly!) (Score:3)
I believe Java is used on the server side more than ever before. I see multiple ecommerce services thriving upon EJB technology.
Swing is of-course used on the client side but not heavily at all. It's mostly the control app's, custom made applications for companys' intranets. Whenever you want more control over your basic DHTML capable browser and if you must satisfy multiple browsers you use Java. The $100 question is are there that many browsers that are not IE out there (except for Linux/Unix/Mac users of-course) Well, Netscape has seing constant decline in PC world, that's just too bad. Opera or c-monkey browsers and other clones are invisible to the public so majority controls are built for Windows. This does not mean that Java is not used because it's bad it means that Java is not provided by those services that only target PC systems.
Book Available Online! (Score:5)
Available in HTML and (gasp!) Word format...