void (@NotNull JPanel component) { JPanel textAndProgress = new NonOpaquePanel(new BorderLayout()); textAndProgress.add(text, BorderLayout.CENTER); final NonOpaquePanel progressWrapper = new NonOpaquePanel(new BorderLayout()); progressWrapper.setBorder(JBUI.Borders.empty(0, 4)); progressWrapper.add(progress, BorderLayout.CENTER); textAndProgress.add(progressWrapper, BorderLayout.EAST); component.add(textAndProgress, BorderLayout.CENTER); }