Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

compile error

 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • 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
 
Francis Siu
Ranch Hand
Posts: 867
  • Mark post as helpful
  • send pies
  • 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 ]
 
Antoine Waugh
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
Thanks a lot.
Nancy
 
Nancy Bradley
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • 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
  • 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 ]
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Marilyn,
sure. just trying to help
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving this to the Swing / JFC / AWT forum...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic