How to change popupTrigger in L&F from right to left button

C

Carla Brommer

I'm looking for a sollution to change the isPopupTrigger for a
MouseEvent from the right mouse button to the left mousebutton (in
Windows). Until now I have solved this problem by writing a
MouseListener for handling the MouseEvent, but reading al the API I've
got the impression that the isPopupTrigger can be changed in the L&F.
But I cant find it, does anybody know how?

Carla.
 
K

Karsten Lentzsch

Carla said:
I'm looking for a sollution to change the isPopupTrigger for a
MouseEvent from the right mouse button to the left mousebutton (in
Windows). Until now I have solved this problem by writing a
MouseListener for handling the MouseEvent, but reading al the API I've
got the impression that the isPopupTrigger can be changed in the L&F.

Since Java 1.3 there's JPopupMenu#isPopupTrigger(MouseEvent).
This in turn asks the L&f's popup menu implementation,
see PopupMenuUI#isPopupTrigger(MouseEvent).

As of Java 1.6 all core L&fs use the behavior
specified in BasicPopupMenuUI#isPopupTrigger.

You can provide a custom PopupMenuUI that
can override the popup trigger behavior.
I'm not aware of a third party l&f that
allows to configure this via the UIManager.

-Karsten
 

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,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top