>JPanel..? JPanel has a getComponent(int index). What about the
>oposite..?
Not likely. Every time a element were added or deleted, the embedded
index number would have to be updated in every Component. It would be
faster just to scan the component list when you need the reverse
index.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
On Jul 23, 10:21 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:
> On Mon, 23 Jul 2007 08:36:45 -0700, pek <kimwl...@gmail.com> wrote,
> quoted or indirectly quoted someone who said :>JPanel..? JPanel has a getComponent(int index). What about the
[quoted text clipped - 7 lines]
> Roedy Green Canadian Mind Products
> The Java Glossaryhttp://mindprod.com
Oh, I see. I was just wondering if there was a method like List's int
indexOf(T element). Anyway, thnks..
Roedy Green - 24 Jul 2007 02:56 GMT
>Oh, I see. I was just wondering if there was a method like List's int
>indexOf(T element). Anyway, thanks..
You are SOL. Inside Component you will see
Component component[] = new Component[0];
It is default scope. So if you extended Container, you could not
access the array of children to do the scan.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com