Basically, you need to import a graphics package into it. Try adding your Main class into the graphics package. It will work.
I hope this will help.
Want to become a Java Expert? Join Java Certification now!!
Want to know more about Java? Watch this video on Java Tutorial for Beginners | Java Tutorial :