JComponent () { JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); JProgressBar pb1 = new JProgressBar(0, 100); JProgressBar pb2 = new JProgressBar(0, 100); progressTimerRequest = new ProgressTimerRequest(pb1); ProgressPanel progressPanel = ProgressPanel.getProgressPanel(pb1); if (progressPanel != null) { progressPanel.setCommentText(Integer.toString(0)); } panel.add(UI.PanelFactory.grid(). add(UI.PanelFactory.panel(pb1). withLabel("Label 1.1"). withCancel(()-> myAlarm.cancelRequest(progressTimerRequest)). andCancelText("Stop")). add(UI.PanelFactory.panel(pb2). withLabel("Label 1.2"). withPause(()-> System.out.println("Pause action #2")). withResume(()-> System.out.println("Resume action #2"))). resize(). createPanel()); Objects.requireNonNull(ProgressPanel.getProgressPanel(pb1)).setCommentText("Long long long long long long long text"); Objects.requireNonNull(ProgressPanel.getProgressPanel(pb2)).setCommentText("Short text"); JProgressBar pb3 = new JProgressBar(0, 100); JProgressBar pb4 = new JProgressBar(0, 100); panel.add(UI.PanelFactory.grid(). add(UI.PanelFactory.panel(pb3). withLabel("Label 2.1").moveLabelLeft(). withCancel(()-> System.out.println("Cancel action #3"))). add(UI.PanelFactory.panel(pb4). withTopSeparator(). withLabel("Label 2.2").moveLabelLeft(). withPause(()-> System.out.println("Pause action #4")). withResume(()-> System.out.println("Resume action #4"))). resize(). createPanel()); Objects.requireNonNull(ProgressPanel.getProgressPanel(pb3)).setCommentText("Long long long long long long text"); Objects.requireNonNull(ProgressPanel.getProgressPanel(pb4)).setCommentText("Short text"); panel.add(UI.PanelFactory.grid(). add(UI.PanelFactory.panel(new JProgressBar(0, 100)). withTopSeparator().withoutComment(). andCancelAsButton(). withCancel(()-> System.out.println("Cancel action #11"))). createPanel()); return JBUI.Panels.simplePanel().addToTop(panel); }