JComponent (boolean indeterminate, Color foreground, boolean modeless) { String text = (indeterminate ? "indeterminate" : "determinate"); JLabel label = new JLabel(text); JProgressBar progress = new JProgressBar(0, 100); progress.setIndeterminate(indeterminate); progress.setValue(0); progress.setForeground(foreground); if (modeless) { progress.putClientProperty("ProgressBar.stripeWidth", 2); } JPanel panel = new JPanel(); panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS)); panel.add(label); panel.add(progress); panel.add(Box.createVerticalStrut(5)); pbList.add(progress); return panel; }