So where's binding in Java at? Don't 'ya just hate that? I'm not sure if using bad grammer even makes a point anymore because so many of us don't recognize even obvious butchering of our language (not that I couldn't benefit from a refersher at this point in my life). I guess I could have said "what's up with binding in Java these days?"

Lately I have been doing my Java programming in Eclipse and NetBeans after loving and using JBuilder just about since it was released (although I have heard I won't be able to do without the Eclipse-based JBuilder which I can never remember is code-named Peleton). I understand that NetBeans 6.0 will have binding but I'm not sure what that will look like and after attending Java One and reading about binding, I think I'm clueless. If you're doing some type of binding now and you're not using the stuff from SwingLabs (assuming you can still find it) or JGoodies, I'd like to know what's working for you.

When I first found JGoodies stuff, I was intrigued by the forms. In fact before Matisse made its debut in NetBeans, I thought I would settle on JGoodies (I say settle because I tend to be an IDE drag-and-drop GUI builder kind of guy). I suffered through trying to build Swing UIs with JBuilder (layout manager within layout manager and so on) and as a general rule gave up coding UI's for production systems by hand back before Clinton "felt our pain." Seeing Matisse in NetBeans previewed at JavaOne '05 made a believer out of me (OK so I can be gullible but I prefer to think of it as optimisitic). It reminded me of the Delphi launch; this stuff still makes me feel like a kid.

So I've just about given up on the SwingLabs binding stuff because I can't tell where it's going for now but I suspect it along with what Scott Violet demoed at JavaOne is probably closer to what will end up in the language and NB 6.0 than the JGoodies stuff. But if you're like me and you need a solution now, the JGoodies stuff is nice and does not have too steep of a learning curve. First you have to get past the idea that your beans must support bound properties (PropertyChangeSupport). Because this is an optional part of the spec, I find it a bit funny that there are what seem to be heated debates over it. If you don't have an easy way to make these changes to your beans, check out the AOP stuff at DamnHandy. There's also HandyAspects on If nothing else this is a nice little diversion which explains why those of us who are not taking advantage of AOP (myself included) might do so.

Assuming you get past that hurdle, JGoodies binding can make you very productive very quickly, yes even using NetBeans. For me the key was the little tip about how to add Custom Creation Code. This is one of those features I stumbled across and told myself I would need that someday soon and promptly forgot about it which, by the way, is one of the main reasons I am trying to blog again. Working under the assumption that this stuff actually shows up on google's radar, someone might actually benefit from it. If not at least it's a personal diary of stuff I've otherwise not recall.

After dropping your components on the form, you can use the Custom Creation Code feature to make a call to one of BasicComponentFactory's methods to make bind it to a ValueModel. This is pretty slick stuff. I'll put up a specific example if anyone asks (or on my own once I get back to that project). As for this weekend there's some yardwork and household issues that need my attention.

Popular posts from this blog

ClassCastException: JAXB

Android and JavaFX

Glassfish Informix JDBC