Write gui programatically, or using an advanced gui editor (Java Swing)?
I am planning to write a Swing-based application (using Netbeans 6.8).
It seems that Netbeans has a very advanced GUI Editor... Still I have my doubts regarding the code generated by it. Additionally I don't like the fact the part of the code is locked (still I understand the need).
Has anybody used Netbeans GUI Editor with success ? Does it "scale" ?
Yes, the NetBeans GUI builder is one of the finest around. I was particularly impressed with how well it handles the infamous GridBagLayout
.
Borland JBuilder was in my experience the very best round-trip GUI editor; if I remember correctly, it produced code without "locked areas" and would usually continue to work gracefully with GUI code that you had manually tweaked.
Still, I have yet to find a Java Swing GUI editor that doesn't occasionally choke on a complex layout, ie enter a state where further editing is no longer feasible and/or requires some backing up or fixing.
Thus, I prefer to hand-code all my GUIs. Heinz Kabutz of JavaSpecialists tells me his GUI editor is vim. However, I admit that most of my other friends and colleagues consider me crazy for doing this.
With the newest versions of Netbeans, you can share projects between Eclipse and Netbeans. So, if you don't like coding in it much, you can use it just for the GUI features and then edit the code in Eclipse. Make sure you create your project in Eclipse first, and then use the importer. They will share the same directory.
http://netbeans.org/kb/docs/java/import-eclipse.html
I have always prefered to write my Swing UIs by hand. I've tried Netbeans but I just didn't trust it to do the right thing for a complex UI (although it was quite awesome for a small simple UI).
I think a lot of us fear writing Swing Layouts by hand because of GridBagLayout. Its not that hard once you've used it a few times. I used to swear by it. However, recently I've moved to a new job and their existing code uses TableLayout instead. Its much simpler and seems just as powerful to me. I've grown to prefer it to GBL. I think you should consider it if you're new to writing Swing.
I'm sorry but I'm not sure about your question of scale.
Best of luck!
Funny side story about JBuilder. My friend who taught me swing taught me to code it by hand, and he always had me put the layout code in a jbinit() method. For several weeks I assumed this was just some code style he used. It was only later I learned that it was an auto-generated method of JBuilder at the time. I didn't need to be using it at all. I was such a n00b :)
链接地址: http://www.djcxy.com/p/30654.html上一篇: 浏览器端代码编辑器组件