日期:2014-05-20 浏览次数:20644 次
public Test() {
super("test");
setSize(300, 400);
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
list(this);
}
public void list(Component comp) {
if (comp instanceof Container) {
System.out.println("container: " + comp);
Component[] comps = ((Container) comp).getComponents();
for (int i = 0, len = comps.length; i < len; i++) {
list(comps[i]);
}
} else {
System.out.println("other");
}
}