Overview
This page provides links to the extended CS 420 example of the word search
program developed using Java, Eclipse, SWT, and JUnit.
The word search program is an assignment from CS 162, but I did this in Java.
None of this code is particularly polished. I'm modifying it as I learn how to do various things. But it's a complete working example.
Versions
The WordSearch06.zip version
doesn't use SWT at all. It contains one bug for you to track down.
The accompanying handout explains how to
get started with Eclipse and how to use JUnit and the debugger (very
briefly).
The WordSearchJan27.zip version supports three different configurations. This version incorporates the Model-View-Controller architecture pattern. The puzzle object does not have any knowledge of the specifics of the user interface. A UserInterface interface lists the required methods of the user interface, and two classes, one text/console based and one SWT-based, implement it. The result is one configuration that is entirely text based as above. Another configuration is the JUnit code for testing the model (puzzle object). The third configuration uses SWT. But there are still some oddities in how this version works. In particular, the graphical version has the name of the data file hardwired into the code.
The WordSearchJan29.zip version supports the same three different configurations. But it uses a FileDialog to obtain a file name and can read from various puzzle files. There are several example puzzle in the Puzzles sub-directory. wsmod02 describes what was updated. The SWT portions have Javadoc-style comments. This is probably the last update of this example.
Snippets of Modification