Old Flame
Still instinctively typing new GridBagLayout()?
Stuart Clements of the Swing Tutorial team is working on updating the Swing trail in the Java Tutorial, and wonders if it's time to shake off old habits and make a major change in their approach. In Layout Management: Use an IDE or Code by Hand?, he writes:
"Have you seen this cool video about the frustrations of coding a GridBag layout manager? We on the Swing tutorial team think this is a pretty accurate portrayal of how frustrating hand-coding a GUI can be, which is why in the latest update of the Swing trails we've decide to encourage the use of NetBeans as much as possible, especially where layout management is concerned. So, do you agree with this approach?"
There's already a huge mass of comments, and the response is mixed at best. For every few readers who endorse the GUI tool approach:
Yes, definitely! Coming from C++ and just started with Java, the reason for choosing Netbeans and not Eclipse was that I like to develop desktop applications and therefor I need to do much GUI Design. And Netbeans was more intuitive to use and Matisse is a great feature!
There are others who won't be coupled to a tool...
Well to be honest I can hardly believe that you're actually serious in asking the question. As long as there is no standard defined for GUI builders it's just way too much risk to depend upon a tool for your code.
some for whom a static-GUI builder won't meet their needs...
I handcode my gui because of readability, reusability and dynamic gui building. I've never seen a gui builder which allows to dynamicaly add a Component.
and some who think the problem is the built-in layout managers:
This is a pretty accurate portrayal of how frustrating hand-coding a GUI can be when using the built-in layout managers, particularly GridBagLayout.
You have to wonder if expanding the scope of the question was really what Stuart had in mind, and if the feedback is the kind of thing that the Swing Tutorial can really address, or if these are comments really meant for another audience, like the Swing team itself. Is the problem with hand-coding your GUI really GridBagLayout, and if so, are the subsequent SpringLayout, BoxLayout and Matisse's GroupLayout not acceptable replacements, or perhaps not well enough understood by long-time Swing programmers? Does using Matisse, which is open-source, really lead to intolerable tool dependency? Lots to debate here, and it's not clear that there's ever going to be an answer that makes everyone happy.
Also in Java Today,
A new article on SDN takes an introductory dive into JRuby and the Java Platform. "This introductory article gets you started using JRuby and the Java platform. It shows you how to set up JRuby, explains the basics of using JRuby scripts with Java applications and the NetBeans integrated development environment (NetBeans IDE), and provides links to help you learn more. Also, the Getting Started section briefly introduces RubyGems and Ruby on Rails."
Inspired by an upcoming book on developing Blu-Ray Java apps, the HDCookbook project is a code repository "to gather useful code for Blu-ray Java, and other GEM terminal specifications like MHP, OCAP, and GEM-IPTV." The project is currently converting from cvs to Subversion, so interested users may want to hold off checking out code until that migration is complete.
In our Feature Article, Marla Parker talks with one of the most prolific java.net bloggers and project owners, in
Top 50: Interview with Kohsuke Kawaguchi of the Hudson Project
In this installment of our series of interviews with developers from some of java.net's most active and prominent projects, Marla interviews Kohsuke Kawaguchi about the Hudson project, a continuous integration server used by large companies and open source projects.
In today's Weblogs,
Sean Sheedy looks at a proposal to take away a prominent MIDP method in
Message from MIDP3: Goodbye pauseApp!
"Should pauseApp be deprecated? How might this impact you? To reduce fragmentation in an age of more capable devices, the MIDP3 Expert Group is considering deprecating pauseApp, and would like to know what the community thinks and how some people might actually be impacted."
Max Poon has an extensive tutorial on
Extending the NetBeans Tutorial JSF-JPA-Hibernate Application, Part 1 - Adding Query View Based on Criteria from Inter-View Parameter Passing.
"While the NetBeans tutorial "Using Hibernate With the Java Persistence API" and "NetBeans Wiki - UsingHibernateWithJPA" demonstrate ease of JSF-JPA-Hibernate application construction with usage of JPA and Hibernate facilities in the persistence-tier, it is interesting to explore also on the flexibility and power of JSF in the web-tier."
Felipe Gaucho blogs about setting up the Footprint project in
Green grass project looking for innovative technologies.
"Imagine you are starting a new project and you can adopt anything you want to produce a web-application or a desktop client. What kind of technology would you prefer? Why?"
Today's Forums actually feature two messages by the same author, tarbo. The first,
Re: Netbeans, Swing, and runtime exceptions, addresses a recent question of how to debug runtime exceptions in the event-dispatch thread:
"A trick (not a pretty one) that I used for a minor Swing application was to attach a custom ExceptionHandler using setDefaultUncaughtExceptionHandler, and then set a breakpoint at entry of its uncaughtException method. Later on, when out of development and into release, I changed it to a output to a Logger et presto. The advantage to this technique is that you catch only uncaught exceptions that would otherwise disrupt the thread, and you have the opportunity to act upon the exception. The downside is that, to me, it just doesn't look clean. But that could be me."
Next is
Re: Reinventing the wheel?, which returns to the question of hand-coding GUI's versus using a visual tool.
"Typically, most if not all of my added components are custom components with custom behaviour. Not that they require special handling--that'd be stupid, eh?--but many of them either use a more dynamic layout or have none at all (e.g. popups). Manual coding allows for more flexibility. Need another component somewhere? If you worked more-or-less cleanly, this shouldn't be a problem, and your other components will go along nicely. Need to hide a component? Just pop it out. That and I'm terrible at visual design and am more than happy to use a layout manager to do it for me. Using a visual design tool would be to my detriment."
Finally, the struggles continue
Re: Building Wonderland on MacOS, according to Kirk Turner.
"There are some native libraries on the system that don't have the power pc (nor 64 bit currently either) builds for them. It should be possible to do, but I think hasn't been addressed yet. Attempts to get Lg3d on Mac weren't given priority because Mac release of Java 5 and 6 were lagging behind the releases from Sun - although some community members did give it a go, and I believe have had some success (I'm not a mac user myself so didn't pay close attention)."
Current and upcoming Java
Events :
- June 12-18 - Java Training Philippines
- June 20-22 - SpringOne
- June 22-23 - Salt Lake Software Symposium 2007
- June 24-28 - Jazoon'07
- June 29-July 1 - Lone Star Software Symposium: Austin Edition
- July 20-22 - Research Triangle Software Symposium 2007
- July 23-27 - O'Reilly Open Source Convention 2007
- July 27-29 - Desert Southwest Software Symposium 2007
Registered users can submit event listings for the
href="http://www.java.net/events">java.net Events Page using our
href="http://today.java.net/cs/user/create/e">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
href="http://today.java.net/today/archive/">java.net Archive.
Still instinctively typing new GridBagLayout()?
- Login or register to post comments
- Printer-friendly version
- editor's blog
- 536 reads





