JDK-6796881 : RFE: Add Java Doc requiring calls to repaint() after container.add() and container.remove()
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 6u10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • OS: generic
  • CPU: generic
  • Submitted: 2009-01-22
  • Updated: 2018-09-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
J2SE Version (please include all output from java -version flag):
java version "1.6.0_11"
Java(TM) SE Runtime Environment (build 1.6.0_11-b03)
Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

Does this problem occur on J2SE 5.0.x or 6.0?  Yes / No (pick one)
Yes

Operating System Configuration Information (be specific):
Client: Microsoft Windows XP [Version 5.1.2600]

Bug Description:
RFE: Add Java Doc requiring calls to repaint() after container.add() and container.remove()

Calling container.add() followed by validate() does not always cause the component to be displayed unless a repaint() is called.
The documentation now says that we have to call validate(), but it does not mention anything about repaint().
The Evaluation of bug 6332772 seems to imply that we may also need to call repaint(), however I can't find that anywhere in official documentation.
I would expect to see this in the Java Doc for container.add() and container.remove()

Comments
EVALUATION It seems that currently the documentation for the Container.add()/remove() mentions that validate() needs to be called on the container that has changed which is not quite correct: given that invalidate() invalidates up to the top of the hierarchy (or up to a validate root after fixing 6852592), the specification for these methods needs to be corrected to mention that the validate() call must occur on the top-level container of the hierarchy (or the validate root - whichever is closer). It would also make sense to link the javadoc to the specification of the Container.validate() method. The note regarding the validation necessity will be added with the fix for 6868255. So this particular CR may add a note regarding calling the repaint() method only. Perhaps the sequence in which validation and repainting occur might be important - that needs to be investigated. It looks that repainting makes sense only *after* validating the component hierarchy.
28-07-2009

EVALUATION Adding requested note would help.
27-07-2009