How to know if a JButton is being pushed ?

I use a JButton. Somewhere in my code I want to know if the button is currently pushed or not. How can I do that ? isSelected method just works for toggle button, not for my button. I can't find any method that says if the button is up or down...Message was edited by:
[298 byte] By [Fred244a] at [2007-11-27 8:18:05]
# 1

A JButton is only "down" while it being pressed with the mouse or keyboard space bar (or

maybe the enter key if it is the default button in the JRootPane). For an AbstractButton

that will hold selected state you can use JCheckBox or JRadioButton in addition to

JToggleButton. Otherwise, use a boolean flag as a member variable in the enclosing class to

keep the "selected" state for you. In other words you have to come with a way to do this on

your own.

crwooda at 2007-7-12 20:03:32 > top of Java-index,Security,Cryptography...