How to have drawn objects(g.draw(...)) respond to mouse events?
<p>I have this program where it draws a bar graph in a JFrame.  The bars of the bar graph change color when I click on them.  So my question is whats the best way to approach this?  The bruteforce way,i.e. calculate the mouse click and see if it falls within the bars' range, or extends the BufferedImage class and have it implement mouselistener?  Because if i were to create a class that extends a jpanel and override its paintcomponent method, it would for sure not run efficiently.  And the bars of the bar graph will be animating also, as in values will be fed to the program and the graphs get updated all the time.</p>
