Skip to main content

NetBeans 5.0 Beta...ouch

Posted by joconner on October 31, 2005 at 5:51 PM PST

I recently discovered Sudoku and decided I'd use NetBeans 5.0 to develop a Java version of the game. I thought it would be a good way for me to play with the latest NetBeans and its new GUI layout tool called Matisse. Turns out Matisse is easy to use, and seems to do the right thing most of the time.

However, I do not like IDEs that generate code that is surrounded with "Do not edit this section. This code is autogenerated." If you work within NetBeans, the editor won't let you directly edit the code anyway. However, despite the "do not edit" warnings, NetBeans does provide a way to insert your custom code into this section. Using the graphical design and "Inspector", you can select any component and view its properties. Some items have properties like this:

Pre-Init Code
Post-Init Code
Pre-Creation Code
Post-Creation Code

You can use these "properties" to add your own code to this "do not edit" section of Netbeans "initComponents" generated code. Fine. However, I have experienced a bug in which after saving and redisplaying my component, this custom code disappeared. Gone. Vanished. I was angry because I had spent more than a few hours writing the code.

I want to use NetBeans, and I want to be a proponent. I'll continue to use NetBeans...but I don't think I'll use the GUI layout tools anymore, at least for a while. I think I'll just hand code my GUIs...what a shame. JBuilder really gets this right. Their GUI layout tool works well, doesn't generate any "do not edit" sections in your code...and it does *not* delete anything you put there either. I like that...sigh...but it's a bit too expensive for me.

Come on can we get rid of those special "do not edit" sections in the generated code? And if you're going to allow a back-door approach to actually putting code into that section, please, please don't delete it.

Related Topics >>