Well, I specifically stated you should NOT be extending JFrame.
There is no need to extend any class. All you need is the class with the main() method that creates the frame and adds the panel to the frame.
I gave you the code for this.
Not only did you change the code but you changed the order of the statements in the code.
Swing components should be added to the frame BEFORE the frame is made visible.
Regarding your custom painting I am not sure why you are extending JButton. There is no need to extend a Swing component to draw a custom Shape.
All you need to do is create your Polygon and paint the polygon in your paintComponent() method.
See Playing With Shapes
for a simple code example that shows how to create a "triangle" Shape and paint the triangle in paintCompoennt.
in your case you have a "shapes" ArrayList. So you need to just create your custom shape and add the shape to the ArrayList. Then in the paintComponent() method you can iterate through the ArrayList to paint all the shapes.
So basically your "drawShape(...)" method should just be a stand alone method that returns the Polygon instance so you can add the instance of the Polygon to the "shapes" ArrayList.
For an example of doing custom painting with a dynamic number of shapes, using an ArrayList see the "Draw On Componnt" example in Custom Painting Approaches
And has already been suggested you should be using a Swing Timer for animation. Swing components need to be updated on the Event Dispatch Thread
(EDT). The Swing Timer executes on the EDT.