• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

compile error

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have to write a program that display color shapes.
I just started and try to compile what I had and got an error message.
Cannot resolve symbol
method setcolor(java.awt.Color)
g.setcolor(Color.green);
Cannot resolve symbol
method setcolor(java.awt.Color)
g.setcolor(Color.cyan);
I do not know what is wrong as it does not display any error for the other colors and they are written the same.
Any help would be appreciate it.
Thanks
Nancy
 
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Nancy Bradley
Which version of compiler you use?
If I have not forgot, previous compiler version is reqiured to change the color name to capital letter
But I forget which version

Please try it

[ April 25, 2004: Message edited by: siu chung man ]
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
heya,
one of your setColor methods had a lowercase 'c' rather than uppercase. the following compiles fine

[ April 25, 2004: Message edited by: Antoine Waugh ]
 
Antoine Waugh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
siu, it really trips me out when i reply and another is immediately there.
dont think i just stole your post


-twans
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Antoine Waugh
Ooooooooooo.....Great, solve the problem
 
Antoine Waugh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
siu, we'll call it a joint effort
*notes so self that siu has about 325098809 more posts than twans*
 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot.
Nancy
 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi I got five errors after adding another figure. Did I forget to include something else in the code?.
Cannot resolve symbol
BufferedImage
Cannot resolve symbol
constructor Rectangle
Cannot reolve symbol
variable g2D
Thanks for your help
Nancy

[ April 25, 2004: Message edited by: Marilyn de Queiroz ]
 
Antoine Waugh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
heya,
firstly you need to add:
import java.awt.image.BufferedImage;
the awt.*; is not enough, as it only reads in the next directory listings.. and because BufferedImage is in image >> BufferedImage simply awt.* is not sufficient.
secondly in your call:

you have a spelling mistake. the RBG is meant to be 'Red Green Blue', so RGB

your other issue is that your g2d variable was being called as g2D. Java is case sensitive.
hope this helps
-twans
[ April 25, 2004: Message edited by: Antoine Waugh ]
[ April 25, 2004: Message edited by: Antoine Waugh ]
 
Sheriff
Posts: 9109
12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Antoine,

I think it might be more profitable for Nancy to do her own typing of code and thus learn about the case sensitivity of Java by experience rather than copy and pasting working code that you write for her.
 
Antoine Waugh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Marilyn,
sure. just trying to help
 
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
reply
    Bookmark Topic Watch Topic
  • New Topic