当前位置: 技术问答>java相关
在java的GUI的应用程序中能否实现对容器(如Frame)中的所有组件遍历?
来源: 互联网 发布时间:2015-03-23
本文导语: 比如说,在Frame中存放了有10个Button,10个Lable,10个TestArea(其中有Disvisible),现在想对这其中的所以控件进行访问(肯定不是通过组件的名称,要不,Disvisible的组件就不知道名了,Frame的什么方法或属性有存有这些数据)哪个高手能...
比如说,在Frame中存放了有10个Button,10个Lable,10个TestArea(其中有Disvisible),现在想对这其中的所以控件进行访问(肯定不是通过组件的名称,要不,Disvisible的组件就不知道名了,Frame的什么方法或属性有存有这些数据)哪个高手能告诉我?????
|
java.awt.Container
getComponents
public Component[] getComponents()Gets all the components in this container.
Returns:
an array of all the components in this container.
不知道是不是你想要的
getComponents
public Component[] getComponents()Gets all the components in this container.
Returns:
an array of all the components in this container.
不知道是不是你想要的
|
应该是
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。