如何使用事件监听Java(JFreeChart)中的点击?
这是我当前使用的代码:
@Override
public void mouseExited(MouseEvent e) {
System.out.println("detectado");
}
This is the code I'm currently using:
@Override
public void mouseExited(MouseEvent e) {
System.out.println("detectado");
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用
addChartMouseListener()
添加一个ChartMouseListener
到您的 <代码>图表面板。例如,在BarChartDemo1
,添加以下内容:You can use
addChartMouseListener()
to add aChartMouseListener
to yourChartPanel
. For example, inBarChartDemo1
, add the following:要监听点击,您必须检查事件类型。
特别是,您可以重写该
方法,该方法是 MouseListeners 接口的一部分。
有关填充示例,请参阅:此链接
To listen for clicks, you must check the type of event.
In particular, you override the
method, which is part of the interface for MouseListeners.
For a fill example see : this link