Three steps to getting a component displayed (assuming that there is a subclass of JPanel being used):
1) add a reference to the component to the subComponent
2) Check that the component has the right stuff
assertEquals(“expected text”, container.subCompoent.getText());
3) Check that the component is going to be visible on the screen
In practice for me I have added another panel to the containment hierarchy in order to use a JGoodies builder to do the laying out. This means that I have made the assert:
I have also got an assertion that looks like this:
This ensures my JGoodies panel is made visible.
After doing this I can do the visual check to make sure it performs as expected. Which it does .