Testing a graphical user interface - GUI is expensive. You need a probe who knows what's going on behind the scenes, to evaluate the functionality of your GUI. To automate functionality tests you can use unit tests and the JUnit test framwork. To test the functionality of your GUI, you can use the jemmy framework together with JUnit.
I made a small example testing a simple GUI with jemmy and JUnit. It's available through blogtorrent and my download site.