I’m new to Java, I’m coding on NetBeans. The problem is that whenever I disable a control
i.e jmenu.setEnabled(false) it still fires events! holy crap! how is it! 😛
How can I prevent it?
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.
To fit in with the event model adopted by Swing, I think your best option is to just add a check of isEnabled() in the handlers that you don’t want executed when the component is disabled.