Glenn Lasseigne wrote:
First. Just to clarify your answer. I am assuming that you meant that I just had to override the single method addImpl. Is that correct?
This is good info for the future. Thanks.
Correct. JPanel inherits its add methods from java.awt.Container which clearly says, for all of its add methods,
This is a convenience method for addImpl(java.awt.Component, java.lang.Object, int).
So override that and it will be called by all add methods.
For the remove methods this is only implied by the "See" clauses, which include remove(int). However, although in
Java 6 remove(Component) indeed calls remove(int), removeAll() does not.