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 -

c# - Abstract method in public abstract class implementing an internal interface doesn't compile? -

authentication - Mongodb revoke acccess to connect test database -