AsyncProcessIcon (@NotNull JComponent component) { List<Icon> result = new ArrayList<>(); for (int i = 0; i < 2 * JBUIScale.scale(GradientIcon.GRADIENT); i += JBUIScale.scale(TRANSLATE)) { result.add(new GradientIcon(component, i)); } Icon passive = result.get(0); AsyncProcessIcon icon = new AsyncProcessIcon("ProgressStripeIcon", result.toArray(new Icon[0]), passive) { @Override public Dimension getPreferredSize() { return new Dimension(component.getWidth(), passive.getIconHeight()); } }; component.addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent e) { super.componentResized(e); icon.revalidate(); } }); return icon; }