void (Container parent) { int width = parent.getWidth(); int height = 0; for(Component c: parent.getComponents()) { if (c instanceof PaletteGroupHeader groupHeader) { groupHeader.setLocation(0, height); if (groupHeader.isVisible()) { groupHeader.setSize(width, groupHeader.getPreferredSize().height); height += groupHeader.getPreferredSize().height; } else { groupHeader.setSize(0, 0); } if (groupHeader.isSelected() || !groupHeader.isVisible()) { PaletteComponentList componentList = groupHeader.getComponentList(); componentList.setSize(width, componentList.getPreferredSize().height); componentList.setLocation(0, height); height += componentList.getHeight(); } } } }