Could you please give me example code for how to remove a listener.? I find your example code very helpful. I have read the api but I don't seem to be implementing what is required as I am getting errors.
chartPanel.removeChartMouseListener(ChartMouseListener.class); //error ChartMouseListener cannot be resolved to a type
chartPanel.removeChartMouseListener(TrendLineMouseListener.class);// is not applicable to the arguments
EventListener[] listeners = chartPanel.getListeners(ChartMouseListener.class);//gets the error ChartMouseListener cannot be resolved to a type.
Thank you
removing listener from ChartPanel
Code: Select all
// MyChartMouseListener implements ChartMouseListener ...obviously
ChartMouseListener cml = new MyChartMouseListener();
chartPanel.addChartMouseListener(cml);
//
// Do something
//
chartPanel.removeChartMouseListener(cml);