Main Goal: Add a few ShapeIcons that I have made into a JPanel p1
so that they can be animated to move throughout the whole JPanel p1
and not disappear once they exceed the bounds of the label they are created in.
// Below is me turning a shapeIcon into a label so it can be added to Jpanel p1
final MoveableShape clock = new Clock(20,10, SHAPE_WIDTH);
final ShapeIcon clockIcon = new ShapeIcon(clock, ICON_WIDTH, ICON_HEIGHT);
final JLabel label3 = new JLabel(clockIcon);
...
p1.add(label3)
All my shapes are added fine to the JPanel but I have them animated and want them to be able to float throughout the whole panel, right now since I only know how to add them into p1
through a JLabel, once the label bounds are exceeded, the shape disappears.
Maybe there is a way to add a ShapeIcon through something other than a JLabel?