• Post Reply Bookmark Topic Watch Topic
  • New Topic

setforeground and setbackground error?

 
mark geroso
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I imported these

setforeground and setbackground keep complaining:

(on eclipse) the error states:

Color.yellow cannot be resolved.
Color.black cannot be resolved.

I've tried Color.BLACK, Color.Black, "BLACK", "Black", same with yellow.
What am I doing wrong?
 
mark geroso
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mark geroso:
I imported these

setforeground and setbackground keep complaining:

(on eclipse) the error states:

I've tried Color.BLACK, Color.Black, "BLACK", "Black", same with yellow.
What am I doing wrong?



[EDIT]
It works now, I had to add

which is wierd considering i already imported java.awt.*.
 
Tim LeMaster
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my guess is you have another class called Color in the same package as this code or being imported.

For a quick fix try

 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!