JCheckBoxMenuItem & JMenuItem

Hey everybody

For my program I'm doing a JMenu and I already have that. I added a JCheckBoxMenuItem and a normal button (JMenuItem). What I want to do is the following: When I click the JMenuItem and the checkbox is not selected a certain function will be made but when the user clicks the JMenuItem but the checkbox is selected a different function will be made.

How can I manage to do this? I'm thinking on doing it with action listeners and item listeners and then use an "if".

Is this possible?

[525 byte] By [eddies1j2a] at [2007-11-27 10:34:01]
# 1

> I'm thinking on doing it with action listeners and item listeners and then use an "if".

try it, see what happens

Michael_Dunna at 2007-7-28 18:26:13 > top of Java-index,Desktop,Core GUI APIs...
# 2

Thanks, I guess I was right and know it works with an if and the isSelected() .

eddies1j2a at 2007-7-28 18:26:13 > top of Java-index,Desktop,Core GUI APIs...