void () { if (myMinimumButtonSizeFunction == null) { return; // called from the superclass constructor through updateUI() } myMinimumButtonSize = JBDimension.create(myMinimumButtonSizeFunction.get(), true); for (int i = getComponentCount() - 1; i >= 0; i--) { final Component component = getComponent(i); if (component instanceof ActionButton button) { button.setMinimumButtonSize(myMinimumButtonSizeFunction); } else if (component instanceof JLabel && LOADING_LABEL.equals(component.getName())) { Dimension dimension = new Dimension(); dimension.width = Math.max(myMinimumButtonSize.width, ((JLabel)component).getIcon().getIconWidth()); dimension.height = Math.max(myMinimumButtonSize.height, ((JLabel)component).getIcon().getIconHeight()); JBInsets.addTo(dimension, ((JLabel)component).getInsets()); component.setPreferredSize(dimension); } } }