In addition to the unit testing tools already listed in the other answers, you may want to read about functional testing as well. For, example: Quick Test Pro
The test scripting language in Quick Test Pro is VB Script. but the created tests can be run against any GUI application, including Java GUIs.