• 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
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

SWT COLOR  RSS feed

 
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
 
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
 
Let nothing stop you! Not even this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!