

A source is an object that generates an Event.Events are supported by number of packages including java.util, java.awt,.Some examples of the events are Java Button Pressed Event, entering a character via keyboard, selecting an item in a list, clicking the mouse etc.Basically they are associated with a component.It is an object which describes a change in a source.4 Which Event is Performed on the Button Click in Java? Java Button Click Event What is An Event ?.3 Which Method is Used to Handle Button Click Event?.2.6 Registering ActionListener to the JButton.2.5 Implementing ActionListener Interface.2.3 Creating another class ActionEventDemo.java.2 Handling Java Swing Button Click Event Step by Step.1.5 Event Classes and Associated Listener Interfaces.


In this example I have created a simple project "My Application" that has a hello world text at the center of the Activity, I have replaced it with a button, the activity_main.xml file looks like this, note that I have added a new attribute android:onClick="buttonClicked" which will be the method in MainActivity. If you are new to Android Programming and Android Studio IDE and want to know how to perform a button on click action you are at the right place,
