NonOpaquePanel (JPanel parent, JLabel text, AnimatedIcon icon) { parent.setLayout(new FlowLayout(FlowLayout.LEFT)); final NonOpaquePanel result = new NonOpaquePanel(); result.add(icon); parent.add(result); return result; }