NonOpaquePanel (JPanel parent, JLabel text, AnimatedIcon icon) { parent.setLayout(new BorderLayout()); NonOpaquePanel result = new NonOpaquePanel(); result.setLayout(new BoxLayout(result, BoxLayout.Y_AXIS)); myProgressBar = new JProgressBar(); myProgressBar.setIndeterminate(true); myProgressBar.putClientProperty("ProgressBar.stripeWidth", 2); myProgressBar.putClientProperty("ProgressBar.flatEnds", Boolean.TRUE); result.add(myProgressBar); parent.add(result, isOnTop() ? BorderLayout.NORTH : BorderLayout.SOUTH); return result; }