Michael Dunn wrote:there's a bunch of things you have wrong, using old depecated methods, using paint() etc
here's a framework for you to play around with.
run it, click anywhere in the panel, drag the mouse sideways, then release it and check the console messages.
Randall Twede wrote:no, that is not a problem just set them both to have the same mouseListener. then in your mouse handling code determine where the event came from. e.getsource(). or let the JFrame handle its and let the JPanel handle its. that might be the best way.