我有这个代码来获取我需要的所有元素并进行一些处理.问题是我需要指定每个面板来获取其中的元素.
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
Run Code Online (Sandbox Code Playgroud)
我想做这样的事情,并获得所有的元素,而不需要specefy所有的面板名称.我是怎么做到的 下面的代码没有获得所有元素.
for (Component c : this.getComponents()) {
//processing
}
Run Code Online (Sandbox Code Playgroud)