Skip to main content



      Home
Home » Newcomers » Newcomers » new Color Class problem
new Color Class problem [message #73607] Sat, 04 June 2005 11:06 Go to next message
Eclipse UserFriend
Originally posted by: farocena.gmail.com

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
Re: new Color Class problem [message #74787 is a reply to message #73607] Tue, 07 June 2005 03:32 Go to previous message
Eclipse UserFriend
Originally posted by: dyd_666_81-eclipsenews.yahoo.it

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).
Previous Topic:Problem installing CDT
Next Topic:org.eclipse.core.commands plugin
Goto Forum:
  


Current Time: Sat May 10 18:59:28 EDT 2025

Powered by FUDForum. Page generated in 0.07710 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top