Thank you so much. The two first lines of code solved it! Now I just wonder what a Painter is? Could someone please link a description or anything? I could not find documentation about it at google or sun.
–
HassenboyAug 24 '11 at 11:54

we must first add this import com.sun.java.swing.Painter; and if we have error do this: 1-Go to the Build Path settings in the project properties. 2-Remove the JRE System Library. 3- Add it back; Select "Add Library" and select the JRE System Library.
–
majid hajibabaDec 17 '14 at 12:30