There is a paint() method define in the JFrame class. If you intend to override that method, you need to code its definition the same as the definition in the class. See the API doc for JFrame.
The JFrame's paint() method is automatically called by the JVM and passed a Graphics object when changes are made to the GUI that need to be redrawn and after the repaint() method is called. Normally code doing custom drawing overrides the paint() method.
If you want to define your own method to do the drawing, you should give it a different name and you will be required to call it to have it be executed.
It is almost always better to subclass a JPanel and add that to the main JFrame, rather than to subclass JFrame itself.
Then your JPanel subclass should override paintComponent:
Note the call to super.paintComponent(). This ensures that the background gets refreshed any time you make a change to what is to be drawn, and also ensures that that any borders are properly rendered. The variables needed to draw things (x,y,width,height,etc.) should be input via the constructor or other methods. You should never call paintComponent() yourself; calling repaint() after you make changes to the drawing parameters will force the JVM to call your paintComponent method with the proper Graphics instance passed to it.
There is a paint() method define in the JFrame class. If you intend to override that method, you need to code its definition the same as the definition in the class. See the API doc for JFrame.
The JFrame's paint() method is automatically called by the JVM and passed a Graphics object when changes are made to the GUI that need to be redrawn and after the repaint() method is called. Normally code doing custom drawing overrides the paint() method.
If you want to define your own method to do the drawing, you should give it a different name and you will be required to call it to have it be executed.