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

authentication - Mongodb revoke acccess to connect test database -

r - Update two sets of radiobuttons reactively - shiny -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -