Browse Source

Fix components not disappearing properly.

Sam Jaffe 5 năm trước cách đây
mục cha
commit
79af991ca1

+ 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);
 	}