They’re both raised once after the mouse button is released and both can have all the information available on the JRadioButton right? Is there any difference?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An
ItemListeners are notified when ever the state of the button is changed, whether through a user interacting with the button or programmatically (via thesetSelectedmethod).ActionListeners on the other hand will be called when a user interacts with the button (but can be simulated programmatically via theonClickmethod).Note that a user interacting with the button such as clicking or hitting the space bar will also change the state of the button and raise an item event as well as an action event. Generally, you will want to define either one or the other, don’t listen for both action events and item events on the button.