The Source for Java Technology Collaboration
User: Password:



Editor's Daily Blog

Bliss

Posted by invalidname on March 20, 2008 at 02:44 AM | Comments (0)

The joy of not writing GUI glue code

I was on a death march project years ago, where the CEO had spelled out what he wanted in our project's GUI, and it was the typical "CEO GUI": seven tabs, each of which revealed a layout with three or four split panes, each jam-packed with as many buttons, tables, and fields as would fit. Sort of like Eric Burke's latest cartoon, but much, much bigger. And totally redundant: all those tabs were largely different views of the same data.

Our team lead was undaunted. Looking at the problem, he took solace in the fact that it was at least possible to wire up the model to all those views. A few TableModelListeners here, some ActionListeners there... a lot to write, but you could at least conceive of someday getting all that code written and compiling.

But something bugged me about having to write all that code. Its purposes were obvious, and it seemed burdensome to express our intentions over and over again to wire all that stuff up.

In our Feature Article, John O'Conner offers a simple class burdened with that kind of glue code, and shows a way out

Note that the basic class is quite simple. A large portion of the code supports the registration of event listeners and the firing of appropriate events at the correct time. As classes and their relationships become more complex, the management of properties, change events, and event listeners can easily represent the majority of a bean's source code.

The Beans Binding libraries help this situation by factoring out the common design patterns and activities involved in keeping properties synchronized. The new library helps you quickly connect properties from different objects, and even helps you avoid writing the same boilerplate code over and over again.

In Synchronizing Properties with Beans Binding (JSR 295) John shows how Beans Binding allows you to drop these hand-written listeners in favor of "binding" properties from two classes to one another, so that a change to one can change the other (and, optionally, vice versa), even handling situations where the binding requires some special conversion because the bound properties are of different types.


In Java Today, Mobile game developers looking to break out of the limitations of 2D can do so thanks to JSR-184, the Mobile 3D Graphics API for Java. According to the ACM Queue article M3G: Bringing 3D Graphics to Mobile Java, "M3G version 2.0 will provide programmable shaders and other OpenGL ES 2.0 features for high-end devices, as well as enhanced traditional rendering for the mass market."

Following the recent release of NetBeans 3.1 Beta, three NetBeans evangelists talked about the most important new features in the latest version of NetBeans in an interview with Artima. They discuss JavaScript and Ruby support in the new version, the possibility of supporting Python/Jython, how they decide which languages to support, NetBeans' new Spring-related features, and other 6.1 improvements.

NetBeans IDE 6.1 Beta is now available to download and preview, and to promote the release, the NetBeans community is holding a blogging contest. "Post a blog describing your experience using the new NetBeans IDE 6.1, a tutorial, insight, tech tip, cool code sample, request for enhancements, etc. Your blog must be linked to a comment or trackback made to the NetBeans Blogging Contest site. Entries must be new material and not copied from something already written. Complete the submission form," or see the contest page for an e-mail link you can use to submit the URL for your blog.


In today's Weblogs, Kohsuke Kawaguchi offers Tips on creating a small JNI jar on Windows. "I created a small library to manipulate Windows processes the other day, and someone showed interest in how to create a small footprint DLL in Windows. So this blog is to explain you what I did."

Qusay H. Mahmoud reports on a Workshop on Mobile App Development at SIGCSE. "I mainly covered Java ME and the BlackBerry wireless device, and talked about my experience in integrating BlackBerry devices into my programming courses..."

Meanwhile, Vivek Pandey has a Report on JRuby On Glassfish@Silicon Valley JUG. "I was at Silicon Valley JUG (Java User's Group) to talk about Ruby on Rails in GlassFish. The slides used in this presentation can be found here. The main theme of my presentation was on highlighting Rails development and deployment on GlassFish v2 and using GlassFish gem with live demos."


In today's Forums, davester reports on JDK6u10 in the browser, in Plugin2 experiences, feature request. "Just wanted to give some notes about my experiences with Plugin2 from the build in jdk-6u10-beta-bin-b13-windows-i586-p-06_mar_2008.exe. Everything generally worked ok with my applet, first of all! So, great work so far. The java_arguments parameter worked great, it was cool to see the new javaw.exe child process with my parameters show up! The browser status bar (in IE or FF) is no longer getting status updates with Plugin2. Is AppletContext.showStatus() not going to print stuff to the browser bar anymore, or is that feature just not implemented yet? Currently, when AppletContext.showStatus() is called with Plugin2, the string goes to the Applet console as "Applet status: %s"."

timothyluke is looking to work through annoyances in Print Dialogs. "The user launches a "Print Preview" dialog which shows thumbnails of the pages that are to be printed and they have an option to manipulate the page size via the page setup dialog. This adjusts the thumbnails in the previewer and saves the pageformat and printattributeset. The problem I have is that when the user presses print and is given the Print dialog - allowing them to choose print queues - they are also presented with a page setup tab. Currently any changes presented here are ignored. Is there any way to hide the page setup tab on the Print dialog? Are there any improvements to the configurability/programmability of the print API's and pageable in 1.6?"

Finally, Sahoo explains the use and misuse of JNDI in Re: Problem on configuring Java Mail Session. "The correct way to look up resource in Java EE is to use the local name (a.k.a. logical name) of the resource rather than the actual JNDI name of the resource. You can run the following sample and see the difference..."


Current and upcoming Java Events :

Registered users can submit event listings for the java.net Events Page using our events submission form. All submissions go through an editorial review before being posted to the site.


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 java.net it will be archived along with other past issues in the java.net Archive.




Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds