必要なすべての要素を取得し、いくつかの処理を行うためのこのコードがあります。問題は、内部の要素を取得する必要があるすべてのパネルを指定する必要があることです。
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
}