Skip to main content

Behind the Lines

Posted by editor on February 21, 2006 at 6:55 AM PST

Take all your Swing layout out of Java

Do we need to have the AWT/Swing layout gripe session again? Very well -- the layout managers you can read (GridLayout, BorderLayout, FlowLayout) generally aren't powerful enough even when nested, and the one that gets the job done, GridBagLayout, requires hundreds if not thousands of lines of code. Then let's also throw in some well-deserved plaudits for visual GUI builders, like NetBeans' Matisse; after coding a few GUI layouts by hand, it's extremely appealing to just drop menus, buttons, fields, and other widgets into place and have it just work.

One particularly popular idea is to migrate the GUI layout and event-wiring into XML code. In a sense, it's analogous to moving the HTML out of the servlet and into a JSP, leaving just a few well-understood points of contact between the GUI design the GUI functionality. Potentially, this allows GUI specialists to stay out of the Java code, and for the business logic programmer to not have to employ visual layout skills he or she doesn't necessarily have.

In our Featured Articles, Joshua Marinacci shows how to get started Building GUIs with SwiXml:

SwiXml is a small Java library created by Wolf Paulus in 2003 to produce Swing GUIs from a small XML language. SwiXml doesn't introduce any new layout managers or component classes. Instead, it directly operates on the Swing classes using reflection. This means that the XML syntax is easy to learn for anyone used to the Swing API. It also has the side benefit of keeping the library very small (under 60k, plus the JDOM .jar), which makes application deployment a pleasant experience.

In Projects and
the Linux Java Community is taking note of A look at GCJ 4.1 by Mark Wielaard. "Version 4.0 of GCJ introduced a new deployment model that made is much easier for distributors to package traditional Java programs as native applications without requiring any source level changes. For version 4.1 of GCJ, this new binary compatibility (BC) ABI has also been used for parts of the core library."

While communication between portlets is due to be addressed by the next Portlet spec (JSR-286), enterprise portal vendors are rolling their own. In InterPortlet Communication API, Roy Russo describes the approach used by JBoss Portal 2.2, saying "we listened to our community and customers and have included an IPC API that is easy to understand and implement."

In today's Forums,
howlerzz suggests enhancements to
JavaOne Online Sessions:
"I have been using the online presentations of past JavaOne conferences to catch up on sessions that I missed and to pass on information to other members of my team...I love the idea. The problem is that a majority of the sessions that I am interested in are in the Desktop track and they usually have in-depth demonstrations of what is being presented. The online sessions do not show these demos. I understand that doing video may be troublesome, but some screen captures presented as slides should be possible. "

skeating explains the state of spec compliance in
Re: JBoss vs. GlassFish (Why Glassfish?) / ok but ...:
"Development is currently focused on the implementation of the Java EE 5 specification and as such the regular builds, that are available today, reflect the state of the specification. In some cases the specifications have completed and are stable, while in others they are reaching final completion. Trailing the development effort are test case development completion. All current tests are run on an ongoing basis, with problems being addressed quickly and frequently."

Felipe Gaucho talks about Using OpenSource projects as classroom material in today's Weblogs.
"Learning J2EE Patterns can be facilitated through an Open Source project. Cejug-Classifieds was designed to help students and teachers to understand the contents of the J2EE Core Patterns book."

Kirill Grouchnikov sarcastically says
The world of ferret hunters is really thriving lately. Sort of:
"'You have a shop that sells ferret-hunting equipment and a guy walks in. Chances are, he'll ask for the latest in ferret-hunting, right?' - does it remind you of anybody?"

In the update
Roller 2.1 on GlassFish, Amy Roh says:
"The Roller 2.1 switched its security system to the Acegi security framework and moved away from container managed authentication. This allows deploying the Roller on GlassFish without having to add a custom JDBC Realm."

In Also in
Java Today
the Hibernate team has announced Seam 1.0 beta 2. The latest version of this framework based on EJB 3.0 and JSF adds two significant new features. "Workspace Management" is "like a Windows taskbar for web applications", allowing the user to view and switch between multiple Seam conversations in a single window. The other new feature is tighter integration with jBPM.

In the article Dependency injection in Apache Geronimo, Part 2: The next generation, Neal Ford promises you'll "get an overview of the Geronimo architecture, discover how DI impacts Geronimo, and learn how to use the DI features in Geronimo to change the way you write code. This article also covers how GBeans work and how Geronimo handles both constructor and setter injection."

In today's
News Headlines

Registered users can submit news items for the href=""> News Page using our
news submission
. All submissions go through an editorial review before being
posted to the site. You can also subscribe to the href=""> News RSS

Current and upcoming Java

Registered users can submit event listings for the href=""> Events Page using our href="">events submission form.
All submissions go through an editorial review before being posted to the

Archives and Subscriptions: This blog is delivered weekdays as
the Java
Today RSS feed
. Also, once this page is no longer featured as the
front page of it will be
archived along with other past issues in the href=""> Archive.

Take all your Swing layout out of Java