CS242: Advanced Programming Concepts in JAVA

Fall 2008

Program 9

Due: 10:00 A.M., Monday, 11/10/08

Our final three programming assignments will culminate in a GUI for playing chess. It does not have to know the rules for legal chess moves, other than the same rules we have been using in our checkers playing programs: you can't move a piece from an empty square or to an occupied square and so on. The only things you need to know about chess are the kinds of pieces and how they are arranged at the start of a game. If you don't know that, I can show you, or you can find out online, for example at Chess game setup

For these three assignments, you don't need to follow the design requirements of our earlier assignments. You can choose your own packaging and organization of your classes, and your handling of user errors. Of course, your program should follow the basic principles of good design and readability that are summarized here, and your program should handle user errors in an appropriate way. The only design restrictions are:

The program should interact with the user entirely through GUI components such as windows, menus, buttons, text boxes and so forth. The details are up to you; the main criterion is that the commands and responses should be easy to understand and use. The only time the command window is used is to initiate execution of the program.

When the program starts, the user should be presented with a window that displays the commands. These will be the same as the commands in Programs 7 and 8, modified to work with a graphics interface. This will be done in Programs 10 and 11. For this program, all you need to do is create and display the graphics objects. Quite possibly, you will want to use different objects or change their appearance in the later programs, and that's fine.

For this program, the window should display the following components:

Your grade will be based on how well you design and implement the code, how thorough your error handling is, on good programming practices, and on thorough testing. Coding guidelines for Java programs are posted here.

Add comment documentation to your program (all classes) and use javadoc to extract the documentation into an HTML file. Include a javadoc comment for each class and each method. The class comment should include your name and the date (use the @author tag). Method comments should briefly describe the purpose of the method, its arguments, and what, if anything, it returns (using @param and @return as appropriate).

The physical location of the javadoc comments is critical. A class comment must immediately precede the line containing the keyword class, and method comments must immediately precede the method.

When you have commented your source files, run javadoc to create the .html files and view them in a browser of your choice.


What to submit:
Your grade on the program will be based on: