Martin Vajsar wrote:Please note that NetBeans keeps backing data for the automatically generated code in a separate file (same name as the .java file, but different extension) and may at will regenerate the code based on information from this separate file, therefore undoing any changes you've made. This is the real reason you should never edit that code.
I think the code with in initComponents() is auto-generated (along with the required declarations for the components). Adding any code in the region apart from the Non-Editable should be fine.
And Martin Thanks for pointing this out.