[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.newcomer] Re: new Color Class problem

Fabián ha scritto:
when I want to set the background color of a label:

label.setBackground(new Color(display,200,111,50));

I get this compilation error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem: Color cannot be resolved to a type


    at SWTHallo.main(SWTHallo.java:31)

Any clues?
Thanks in advance,
Fabián



I hope you have imported this...
import java.awt.Color;
If so, check the properties of your project: Java Build Path - Libraries should contain a library with java.awt.Color.class (usually, it is in rt.jar inside JRE System Library).