开发者

Disabled Jbutton Swing not working well

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜