JComponent () { int cycles = 20; Icon passive = AllIcons.Process.Big.Step_passive; Icon[] icons1 = { AllIcons.Process.Big.Step_1, AllIcons.Process.Big.Step_2, AllIcons.Process.Big.Step_3, AllIcons.Process.Big.Step_4, AllIcons.Process.Big.Step_5, AllIcons.Process.Big.Step_6, AllIcons.Process.Big.Step_7, AllIcons.Process.Big.Step_8 }; List<Icon> iconsList2 = new ArrayList<>(); for (int i = 0; i < cycles; i++) { Collections.addAll(iconsList2, icons1); } Icon[] icons2 = iconsList2.toArray(new Icon[0]); JPanel panel = new JPanel(new BorderLayout()); AnimatedIcon animatedIcon1 = new AnimatedIcon("Casual", icons1, passive, 600); AnimatedIcon animatedIcon2 = new AnimatedIcon("Long", icons2, passive, 600 * cycles); animatedIcon1.resume(); animatedIcon2.resume(); panel.add(animatedIcon1, BorderLayout.WEST); panel.add(animatedIcon2, BorderLayout.EAST); return panel; }