问题
It seems to me that the chartMouseClicked
method gets called only when the user left-clicks on a chart. What's being called when the user right-clicks on a chart and the popup menu is displayed? I want to do something in the background when the user right-clicks before the popup menu is displayed. Thanks!
回答1:
ChartPanel implements MouseListener
to display the context menu. To accommodate disparate platforms, it checks isPopupTrigger()
in both mousePressed() and mouseReleased(). You may need to override both methods.
来源:https://stackoverflow.com/questions/7758759/right-clicking-on-a-jfreechart