So … there I am, looking at my peg solitaire board. Looks nice…
But how could I possible figure out what would be a legal move or not? I think I’ve missed a few part in my lousy design.
I have a Vector that contains 9x9 Jpanels that makes upp the Squares of my board-
I have an Array containing all the illegal squares(in the corners, the ones painted black that shouldn’t have been in the first place… GridLayout…)
So, when I press my mouse, I see if I’m grabbing a JLabel (my Gamepiece) and then I get the index of the parent Jpanel. When I release my mousebutton I check if the square is empty and then I can get the index of that Jpanel
But… then what, I have two indexnumbers…? My Math isn’t very good… is there really a magic formula to control that thing?
Or should I store every objects row and column somehow, then I could see if the difference between the “fromSquare” and “targetSquare” row,column are 0,2 or 2,0. One of them must be 0 and I can only jump one square.
Then… of course… I must check wether or not the square I’m jumping contains a Jlabel too … 
As said… my math… my logic… my brilliance… that never were… 

