• Post Reply Bookmark Topic Watch Topic
  • New Topic

Why insist in writing Swing by hand after the NetBeans5.0?  RSS feed

 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I downloaded NetBeans5.0 yesterday and try to build Swing GUI with its Masstise. Ammazing!!!
I've writen Swing GUI by hand more than a year, I think it's time to convert to NetBeans' form builder right now.
If someone insists on writing by hand, please let me know your reasons.
 
David Irwin
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would agree, Matisse is an amazing tool and I've used it quite a bit myself. But if you're just starting to develop Swing applications, I believe that it's imperative that you understand what is going on behind the scenes. It's been my experience that you really learn Swing by getting your hands dirty.

Just my $0.02.

Dave
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the advantages I see from handcoding Swing GUIs is that, if you care, you can create a lot of reusable code: widgets, builders, layout managers, renderers etc. That way, handcoding GUIs can become really easy, and the GUI looks very consistent and is easy to change.

Now, what are the advantages you see in using a GUI "drawing" tool? (Disclaimer: I've never used Netbeans.)
 
Qunfeng Wang
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK. Let me tell you my story. When I was a student I typed the code line by line as every java book instructed. It's quite a boring work especialy when I couldn't use Swing's Layout Manager well. When I came to work I use the IDE JBuilder which provides a GUI Builder. Lots of people in my office build their GUI with this tool. So I convert to a GUI Builder first time. But I find it's not so well. It can't integrate Swing's Layout Manager with it properly. This is where NetBeans5.0 is better. It just uses only one Layout Manager: GroupeLayout.

I don't know how to express myself clearly in English. Would anyone has used NetBeans5.0 help me to explain the advantanges of NetBeans GUI Builder Tool? Thanks a lot!
[ February 10, 2006: Message edited by: Loius Wan ]
 
Brian Nahas
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Problems with GUI builders:

-First and foremost, you can't create dynamic layouts.
-You can't use component factories.
-They use binary formats or generate code you can't touch
-Everyone on a team has to use the same tool
-You have to make sure the your generated layout code and the tool your using are compatible (what happens when Mattise 2 rolls around?)
-If you don't use that editor regularly, you have to context switch out of your own to change something

You're better off hand coding your layouts. If you find the current layout managers to be difficult to work with, check out ZoneLayout (http://www.zonelayout.com).
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!