witam
napisałem programik w java który zajmuje się przesuwaniem obiektów rysowanych na JPanelu, rysuje i przesuwa on pojedyncze figury geometryczne, ale wykrzacza się przy dodawaniu figur do ArrayList co niestety jest dla mnie obowiązkowe w tym zadaniu:
Let CompoundFigure inherit Figure. Compound figure contains other figures which are stored in an ArrayList. CompoundFigure has the method public void add(Figure f), which adds a new Figure object to the compound figure. Compound figures do not have their own position, and it is not important what values are assigned to x and y coordinates. Compound figures draw themselves by asking their parts to draw themselves; the same thing happens when a compound figure moves. This means that the inherited method move has to be overwritten!
czy można prosić o jakieś sugestie?
https://4programmers.net/Pastebin/9388
Exception in thread "main" java.lang.StackOverflowError 62 linia w pastebin