File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes cant access graphics Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply 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: 1788
    
    2
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: 32644
    
    4
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: cant access graphics
 
Similar Threads
GUI Example (HFJ)
HFJ TwoButtons problems
Swing graphics problem
need help with my code
GUI Problem