"tim" wrote...
> > First *cast* the object you get from the Vector
> > to the desired type, before calling its methods.
>
> is that what Bjorn suggested to do? Like:
>
> tempMenuItem = (MenuItem)MenuItemList.elementAt(i);
Yes.
> ? Because I tried this, but Eclipse doesn't seem
> to accept this either... nor the notation:
[quoted text clipped - 4 lines]
> normal objects from this class, so the class is definitly
> known in the project...
What is "Eclipse" complaining about when you try
some of the lines above?
What's the error message?
// Bjorn A
P.S. The preferred method to use instead of
elementAt(int) is get(int), since JDK 1.2.
tim - 01 May 2004 16:17 GMT
> What is "Eclipse" complaining about when you try
> some of the lines above?
>
> What's the error message?
Well, it was first the same as the first message, then it was complaining
about expecting an array type... Very weird, so I deleted the whole thing,
wrote it again, and now it seems to accept most of it. Thanx for the
information. The problem with java is that it is so popular that google
finds way to much. ;-)
greetings
Tim
javac - 07 May 2004 23:23 GMT
[..]
> // Bjorn A
>
> P.S. The preferred method to use instead of
> elementAt(int) is get(int), since JDK 1.2.
more important, it's better to use an interface (ie, list) than
vector. using the interface gives you more flexability down the road.
you might want to change that vector to ArrayList or whatever it's
called :)
javac@mail.com
http://www.geocities.com/cjavacjava/