Jump to content

  • Log In with Google      Sign In   
  • Create Account


derkotah

Member Since 17 Dec 2012
Offline Last Active Dec 17 2012 02:23 PM

Posts I've Made

In Topic: Chess Movement Using Mouse Listeners (Java)

17 December 2012 - 11:15 AM

You are calling the method to highlight solution squares on the mouseReleased event instead of the mousePressed. MousePressed is the trigger for your "drag" and MouseReleased is the trigger for your "drop". What do you need to know exactly about mouse listeners ?

I've tried the method in both mousePressed and MouseDragged and both come up null. I wanted to use the BoardState class to figure out the square's location and chesspiece, so that I can verify whether it is null or not, but I haven't exactly found a way to do that as I can't pass in any parameters to a mouseEvent. I'm knowledgeable enough about mouseListeners to complete the task, it's more rather how to implement it that's keeping me back.

PARTNERS