CS361

Project 2
Dragging cards
due: Wednesday, February 20, before class

Assignment

Add the following features to the Swing window that you created in Project 1:

Details

  1. Initially, the four empty slots should be on the left end of each row, but the 52 cards should fill the remaining slots in random order.
  2. When you click on a card and start dragging it, it should smoothly move with the mouse as if you had stuck the mouse to the card at the point where you pressed the mouse button.
  3. While a card is being dragged, it should appear above all other cards in the JFrame.
  4. When you release the mouse button after dragging, the card should stay where it is.
  5. The empty spots (that is, the gray rectangles) should not be draggable.
  6. As always (including this project and all future projects), all your methods need to have Javadoc style headers.

Extra Credit

What to hand in

Hand in a hard copy of all the source code files you created or modified and also zip up all source code files and send the zip file to me as an email attachment. See the course web page on handing in assignments for further details.

For fun: An Ambiguous Recommendation

"You will be lucky to get Ben to work for you."