![]() The class provides the method Object getItem() - It returns the object that was selected Checkbox/JChcekbox - when the state of the checkbox is changed.This event is generated when an item is selected or deselected in an item selectable component. It returns the current value designated by the adjustable component. This event is generated when adjustments are amde to an adjustable component such as a scrollbar. Name associated with this action, such as a button label, a menu-item name, a list item name, or text. This class provides the following method: String getActionCommand(). TextField/JTextFiled - when the Enter key is hit in the text field.Menuitem/JMenuitem - when a menu item is selected.List/JList - when a list item is double-clicked.Button/JButton - when a button is clicked.This class is generated by by an action that is performed by any of the following components: ![]() Selecting a menu item, scrolling, and changing text in a text filed or a text area.ĪctionEvent AdjustmentEvent ItemEvent TextEvent ActionEvent These classes represent user interaction with a GUI component. The AWTEvent class is divided into two types of events. Object getSource() - that returns the object that generated the event. Provide the appropriate actions in event listeners to deal with the events received.īefore implementing these two sub-tasks, lets's look at the event hierachy.Set up the propagation of events from event sources to events listeners.The way that this model works can be divide into the following two sub-tasks: Event listener objects that are informed by an event source when designatedĮvents occur, so that the event listener objects can take appropriate action.What pieces of information are contained in these events.Event source objects inform event listeners about events:. ![]() Event classes encapsulate information about different types of user intereaction. ![]() Such interaction could be things such as:Įvents such as these can take place in any arbitrary order, and the application must be able to handle themĮvent handling in Java is based on the event-delegation model in which: User interaction such as with the GUI results in eventsīeing generated to inform the application of user interaction. Overview of Event Handling The Event Hierarchy Semantic Events Low-Level Events The Event Delegation Model ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |