Why does JMenuItem react to right button?

D

diegomrosa

In all the applications that I know, menu items react only to mouse
left-click. Swing JMenuItem, however, reacts to any mouse button click.
Swing JButton (which also extends AbstractButton) behaves as expected.
Does anybody know why? Is there any way to change this behavior?

Thanks in advance,
Diego
 
R

Robert Iver

I'm sure that the behavior can be changed by modifying the event
listeners associated with the JMenuItem. Or, just have your program
check which mouse button was pressed, and then just ignore that
event....

There's always a way to get the computer to do what you want, as long
as you can somehow manage to tell it what you want. lol :)

I'm sorry I can't be of more help, just learning Java myself.....maybe
a more senior programmer can give some code samples or something.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top