void () { Component template = getBaselineTemplate(); if (template == null) { return; } int baseline = template.getBaseline(template.getWidth(), template.getHeight()); if (baseline == -1) { return; } int components = myLeftPanel.getComponentCount(); for (int i = 0; i < components; i++) { Component component = myLeftPanel.getComponent(i); if (component == template) { continue; } int y; if (component instanceof JLabel) { y = (int)(JBUIScale.scale(1.5f) + (template.getHeight() - component.getHeight()) / 2f); } else { y = baseline - component.getBaseline(component.getWidth(), component.getHeight()); } component.setLocation(component.getX(), y); } }