Use to set source objects to trigger events to which one or more objects with event listeners react. You can also remove events using the Event Handler Dialog. Whenever you define an event handler, the code for the listener and the empty body of the handler method is generated. In addition, the default name is assigned to the event handler.
Notes:
If multiple events are of the same type, you can use the same handler for all of them. For example, you could set both focusGained
and focusLost
to use the button1FocusChange
handler since they are both of the type java.awt.event.FocusEvent
. You can also use the same handler for the same event on multiple components.
When you remove an event handler, the corresponding code block is also deleted. If more than one handler uses the same name and same block of code, deleting a single reference to the code does not delete the code itself. Only deleting all references will delete the corresponding code block, and a confirmation dialog box is displayed first.
Related Topics
Developing Applications with NetBeans IDE,
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements; and to You under the Apache License, Version 2.0. |