<Swing Dev> <AWT Dev> Review request #3: 6852592 (revalidate() must be smarter)
Christopher Deckers
chrriis at gmail.com
Fri Jul 31 10:29:59 UTC 2009
Hi all,
I may be thinking out loud... but talking about incompatibilities:
In a situation where a container has a JScrollPane with a JComponent
somewhere down its hierarchy,
component.invalidate();
container.validate();
// Use some layout related values immediately
... would not have any effect anymore. Under some certain
circumstances, revalidate is not used because of the fact that the
call is deferred. Maybe for those extreme cases it is desirable to
introduce a method:
public Container getValidateRoot()
That method would never return null unless the component is not
connected to a hierarchy leading to an applet or window. The code
above could be converted to:
component.invalidate();
component.getValidateRoot().validate();
Cheers,
-Christopher
More information about the swing-dev
mailing list