java - JFreeChart XYPlot XYImageAnnotation mouse click listener -


i have jfreechart 2 subplots (xyplot).

i have xyimageannotations want become buttons, can't find way listen mouse click on annotation.

do know way this?

i have no idea how listen [for] click annotations

in chartmouselistener, you'll chartmouseevent. use chartentity that's xyannotationentity.

chartpanel.addchartmouselistener(new chartmouselistener() {      @override     public void chartmouseclicked(chartmouseevent cme) {         chartentity ce = cme.getentity();         if (ce instanceof xyannotationentity) {             // handle click         }     } } 

otherwise, xyitementity added annotation.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -