Question

I have a ChartPanel object displaying some information, but I would like to be able to use a MouseListener interface to draw on top of it. I'd imagine I would just have to call some sort of "repaint()" method at the end of the interface methods and perform some override, but after spending considerable time researching I haven't a clue how to go about doing this. Is this even possible? Any insight or advice?

Was it helpful?

Solution

You can create a class that implements the Overlay interface and then add it to the ChartPanel using the addOverlay(Overlay) method. Everything that the overlay draws will be drawn after (so on top of) the chart.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top