Here are some of the basic building blocks of Objected-Oriented Programming that you will become familiar with:
main) can only reference static variables in its own class (or its own local variables).
static finalvariables (constants) that can be used by all methods, or by other classes.
Color.blueis an example of a static final variable.
paintComponentmethod, you are overriding the one that is already defined in JPanel. In paintComponent, but not in most overriding methods, you should call the method in the parent class with
super.paintComponent. The "super" keyword is how you refer to the overridden parent method. There is no way to explicitly call the "grandparent's" method if it was overridden by the parent class.
implementsan interface must define all those methods. The method signatures (prototypes) are listed in the interface. Interfaces may also define public static final "constants". An interface is essentially the same as an completely abstract class.