I do not think this is a mistake. In fact, netbeans does not allow editing source code in a method initcomponents(). In the properties window (Ctrl + Shift + 7), where you see the main tabs (properties, binding, events and code), after selecting a component and viewing its properties window, if you select a code, you can add any code you want, Creation code, Pre-Creation code, code after creation, pre-initialization code, code after initialization .....
Hope this helps.
source
share