Use the @Override annotation for your paintComponent method for rude surprise. This is why using this annotation is very useful, as it will tell you at compile time if you do not override the method when you think it should be.
Solution: never "draw" in a JFrame for many reasons. Instead, do what the tutorials tell you - draw in the JPanel or JComponent method paintComponent(...) . If you search this site, you will find that we have told many people the same thing, and in fact I suggest that you do just that. I would not be surprised if this question is closed as a duplicate, since this is a fairly common question.
Note that this will not work (and will not actually compile):
super.paintComponent(g); << Can't seem to get this to work.
for the same reason - there is no super.paintComponent(g) for JFrame.
In addition, as far as
I used to work with paintComponent (), but still can't figure out what I'm doing wrong.
But if you look at your previous code, you will see that this method has never been used directly in the JFrame, and it should not either.
source share