Swing method overriding


I am trying to compile class A that extends javax.swing.pfaf.basic.BasicComboPopup

I am using java 1.1.8 and Swing1.1.1
I am getting the following error message:

"Method void syncListSelectionWithtComboBoxSelection in class mypackage.A does not override the corresponding method in class javax.swing.pfaf.basic.BasicComboPopup which is private to a different package"

I have a method in class A
protected void syncListSelectionWithComboBoxSelection();
But I did not find any such method in any of the classes in Swing-1.1.1, and neither in java1.2 and 1.3(that have swing library included).

Can you please explain why is the compiler mentioning that when there is no such method in the parent(s), classes of class A.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.


   Look at the source file of javax.swing.pfaf.basic.BasicComboPopup.java file, you can see the funciton
  void syncListSelectionWithtComboBoxSelection() has been declared and it's used only by the class. Since it's access level is package level it will not be shown on swing api documention

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
simiAuthor Commented:
simiAuthor Commented:
Can you also please explain why is it so ?
Package level means that the method will be available to all classes in the package but also to all the subclasses.
If one wants to subclass such a class the subclass will inherit this method. So one could use it or override it.
Should not that clas be shown in the api ?
It looks to me that only private methods do not need to be shown as they will not be available to other classes.

if it's package level then its available to all classes in the package but not the subclasses which are not in the same package level.  If the subclasses is with in the same package the method can be overridden
simiAuthor Commented:
For some reasons I was thinking at protected instead of package.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.