It's not a secret anymore!*
The moose likes Java in General and the fly likes cant access graphics Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "cant access graphics" Watch "cant access graphics" New topic
Author

cant access graphics

chanakya nani
Greenhorn

Joined: Jan 11, 2011
Posts: 29






i'm getting an error that "

"Exception in thread "main" java.lang.Error: Unresolved compilation problems:
paintComponent cannot be resolved to a type
paintComponent cannot be resolved to a type

at oval.main(oval.java:8)"
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 2156
    
    7
paintComponent() is a "method", not a "class". You can't create an instance of it.

I suggest you read the section from the Swing tutorial on Custom Painting.

Also, use the "code tags" when posting code so the code retains its formatting and is readable.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38087
    
  22
Rob Camick wrote: . . . Also, use the "code tags" when posting code so the code retains its formatting and is readable.
since he's new, I'll do that, and we can see how much better the post looks.
chanakya nani, welcome to JavaRanch

I would advise you not to use an IDE at this stage; get used to a decent text editor and write the GUI code by hand. Also get used to the Oracle/Sun compiler's error messages.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cant access graphics
 
Similar Threads
GUI Problem
HFJ TwoButtons problems
GUI Example (HFJ)
need help with my code
Swing graphics problem