> how can you do something like that?
> .
> Say you want to Iterate through all JButtons in a JPanel ...
> .
> onetitfemme
U can use one of the following methods
Component[] getComponets() method, which returns an array of all the
components.
or
int iCompCount = someContainer.getcomponentCount();
for ( int loop = 0; loop < iCompCount; loop++)
Object o = someContainer.getComponent(loop);
Bhanu - 14 Sep 2006 09:51 GMT
> > how can you do something like that?
> > .
[quoted text clipped - 12 lines]
> for ( int loop = 0; loop < iCompCount; loop++)
> Object o = someContainer.getComponent(loop);
and i forgot to tell u can always use instanceof operator..
for ( int loop = 0; loop < iCompCount; loop++)
{
Object o = someContainer.getComponent(loop);
if( o instanceof someComponentType)
do what needed..
}