由容器获取组件

来源:互联网 发布:什么网络麻将游戏赚钱 编辑:程序博客网 时间:2024/05/09 06:20
int count = panel.getComponentCount();
for (int i = 0; i < count; i++) {//获取其组件
Component comp = panel.getComponent(i);
if(comp instanceof JLabel){
((JLabel) comp).setText("查看成绩");
}
}
原创粉丝点击