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

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top