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.
When defining an event handler, the button in the properties panel displays the "Handler for <eventname>" dialog. Currently this give you the option of adding, removing, or renaming a handler. Often there will be a handler that can be reused for multiple components. For example, a focusGained handler for JTextFields that calls selectAll() to select the contents of the field. Currently the only way of reusing a handler is to select the value field in the Properties dialog and type in the name to use. To the best of my knowledge, there is no way to accomplish this through the "Handler for <eventname>" dialog; only through the Properties dialog. I propose either: adding a new "Select" button, or enhancing the "Add" button to display a list of existing handlers bearing the correct signature. So, when adding an actipnPerformed handler it would show all methods with the signature void XXX(java.awt.event.ActionEvent YYY). This would make it a lot easier than having to type in the name. In complex forms you can wind up with a lot of these and picking from a list would be much easier. Especially in light of the fact that when you are making the choice you are in the Design view and cannot simply browse the code for the correct name
Maybe we could also change the combo in property sheet so it shows the available compatible handlers rather than showing the handlers attached to the event. Having multiple handlers attached to an event is less usual than using one handler for more components. The case of mutliple handlers to one event would be only handled by the dialog.
Created attachment 42583 [details] Proposal for org.netbeans.modules.form.EventCustomEditor
How about this for the event custom editor: attachment 42583 [details]