I have a problem with Swing JButtons. I'm working with Netbeans. When I disable a JButton in the GUI Builder it still fires the actions attached as events, i.e. I have a disabled button with an onClick trigger. No matter if disable, the trigger is working.
Somebody knows how to avoid this behavior? and the disabled jbutton fires the actions just when enabled?
Thanks a lot
You need to use an ActionListener vs a MouseClickListener.
Technically, the user did click in your button. :)
http://download.oracle.com/javase/tutorial/uiswing/events/actionlistener.html
Did you try a button.setEnabled(false) in code ? Maybe Netbeans is not setting the property properly...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With