右键单击JFreeChart [英] Right-clicking on a JFreeChart

查看:58
本文介绍了右键单击JFreeChart的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我看来,仅当用户在图表上单击鼠标左键时,才会调用chartMouseClicked方法.当用户右键单击图表并显示弹出菜单时,该怎么称呼?当用户在显示弹出菜单之前右键单击时,我想在后台执行某些操作.谢谢!

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!

推荐答案

ChartPanel 实现MouseListener以显示上下文菜单.为了适应不同的平台,它会在两者 mousePressed() mouseReleased() .您可能需要覆盖这两种方法.

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.

这篇关于右键单击JFreeChart的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆