This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I love to work with NetBeans for designer. But one thing I have (not NetBeans, but every form designer I seen today), is mixing form design code AND logic code. To address this issue, the method calls for event handling should have a config option to be generated abstract. So, I will extend the UI class and implement logic code, implementing all calls. Actually the variables already can be declared protected, so I can access them. The only piece are missed is abstract methods. Example: btnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelActionPerformed(evt); } }); . . . private void btnCancelActionPerformed(java.awt.event.ActionEvent evt) { // Add your handling code here: this.documento = null; doClose(); } should be btnCancel.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnCancelActionPerformed(evt); } }); . . . protected abstract void btnCancelActionPerformed(java.awt.event.ActionEvent evt); (The method could be protected, or public... It should be configurable too). This will solve my trouble regarding guarded blocks too. Thanks, Edson Richter
This is a reasonable requirement, however it would require some additional configuration to be introduced for the event handling (i.e. type of the event handler method). That is rather big change, e.g. from UI point of view, which I am not sure when we could implement. There is still a workaround - to call from the private method your own method that can be of any type. From this point of view, a better enhancement would be probably to allow the user to specify their own event handling method directly - not generating a guarded method skeleton if the user can provide a suitable method by themselves.
See also issue 25010.
*** Issue 89785 has been marked as a duplicate of this issue. ***
Gets my vote,