There are two aspects to the TDD GUI. The GUI setting itself (say drag and drop), and then there is a GUI (click this button, launches the URL in a web browser).
As for the GUI itself, I recommend Test Just After, where you write some code and see that Swing really does what you expect from it, and then you put this code in a test method that blocks the behavior. You still keep it small, so you need to test the design several times, but in the end, the Swing environment controls the design more.
Regarding what the GUI does, you keep the unverified part as thin as possible and first write a test to call a method that does what you need. For example, adding an action listener may remain unchecked, but an action listener does nothing more than delegate a method that is under testing.
At some point you should remember that this is unit testing, so of course it is possible that all of your tests pass and Swing still doesn't behave the way you want. Do not expect TDD to give you better. Functional tests also take place.
I found that Abbot can potentially help in the first type of Just After test, but this is not enough to justify an additional tool (in our project we have frames coming out of the ears, so I try to be reasonable about how much we use).
Yishai
source share