You have two different listener objects here, one is a MouseListener
instance (that listens to mouse events on the panel) and the other is a ChartMouseListener
instance (that listens to mouse events on the chart in the panel). They are registered in separate listener lists, and the isDoubleClicked
field from one object isn't visible to the other object.
The reason that ChartMouseListener
is separate from MouseListener
is that JFreeChart creates its own events that contain additional information about the entity in a chart that is "underneath" the mouse pointer.