我有这段代码来获取我需要的所有元素并进行一些处理。问题是我需要指定每个面板,我必须在其中获取元素。
for (Component c : panCrawling.getComponents()) {
//processing
}
for (Component c : panFile.getComponents()) {
//processing
}
for (Component c : panThread.getComponents()) {
//processing
}
for (Component c : panLog.getComponents()) {
//processing
}
//continue to all panels
我想做这样的事情并获取所有元素而无需指定所有面板名称。我如何做到这一点。下面的代码没有得到所有的元素。
for (Component c : this.getComponents()) {
//processing
}