• Post Reply Bookmark Topic Watch Topic
  • New Topic

SWT COLOR  RSS feed

 
Mikealan Smith
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to Java and for a class project i'm doing, I have decided to try to use SWT instead of Swing. I don't know how to do either one at this point, so i thought i would give SWT a whirl.
I finally got my first Hello World GUI going last night and started adding some things to it. i have added a label and associated with this label i have tried setting the background color as such
label3.setBackground(new Color(display,200,111,50));
This was taken directly from a tutorial. However i get
Color is not found or is not a type.
I am using Eclipse 2.02
My imports are
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.*;
Any ideas what I need to do to fix this.
Thanks
Mike
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SWT Color class is in the org.eclipse.swt.graphics package... you'll need to import that too.
 
Mikealan Smith
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
That is exactly what i was looking for. The tutorial i was using didn't show this
I have another question about SWT but i'm going to start a new thread for it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!