This is the code I'm currently using:
@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");
}
You can use addChartMouseListener()
to add a ChartMouseListener
to your ChartPanel
. For example, in BarChartDemo1
, add the following:
chartPanel.addChartMouseListener(new ChartMouseListener() {
public void chartMouseClicked(ChartMouseEvent e) {
System.out.println(e.getEntity());
}
public void chartMouseMoved(ChartMouseEvent e) {}
});
To listen for clicks, you must check the type of event.
In particular, you override the
public void mouseClicked(MouseEvent ev)
method, which is part of the interface for MouseListeners.
For a fill example see : this link