Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

setforeground and setbackground error?

 
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.*.
 
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

 
Your mind is under my control .... your will is now mine .... read this tiny ad
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic