Anthony Petrov wrote:
Possible solutions include:

1. Adding a call to revalidate() method immediately after the components have been added to the container in the test code. However, from Swing perspective this looks like a backward incompatibility.

2. Overriding the JComponent.addImpl() method and putting the call to revalidate() there. This, however, may introduce some performance regression.

I like #2. Adding children to a container does indeed affect the container's layout, so it's reasonable to call revalidate().

--
Peter              |  x33066  |  location: SPB04  |  timezone: GMT+03

Reply via email to