소스 검색

Fix components not disappearing properly.

Sam Jaffe 5 년 전
부모
커밋
79af991ca1
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      src/main/lombok/org/leumasjaffe/recipe/controller/ReplaceChildrenController.java

+ 4 - 0
src/main/lombok/org/leumasjaffe/recipe/controller/ReplaceChildrenController.java

@@ -22,6 +22,10 @@ public class ReplaceChildrenController<T, V> implements BiConsumer<Container, T>
 		if (parent.getComponents().length == children.size()) {
 			return;
 		}
+		// Make sure that our components disappear correctly
+		for (final Component comp : parent.getComponents()) {
+			comp.setVisible(false);
+		}
 		parent.removeAll();
 		children.stream().map(makeView).forEach(parent::add);
 	}