Results 1 to 3 of 3
  1. #1
    caryr is offline Member
    Join Date
    Nov 2008
    Location
    Colorado
    Posts
    18
    Rep Power
    0

    Default SWT color creating and image using.

    Okay this question has two parts.
    1) how do I create a custom color in SWT and use it as a background.
    Right now I'm doing this;
    labelVistorTeam.setBackground(Display.getCurrent() .getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    Would like to change it to:
    Color myColor = new Color(255,85,0);
    labelVistorTeam.setBangground(myColor);
    This does not work

    2) I would like to import a image file and set it a a background for my frame.

    Any help would be great. I have been looking on line for solution for about 3 hours and can not get it to work. Please help

  2. #2
    Palani is offline Member
    Join Date
    Dec 2009
    Posts
    2
    Rep Power
    0

    Default

    Create Color Object using "Color FORE_COLOR = new Color(Display.getCurrent(), 119,136,153)"

  3. #3
    AndreB's Avatar
    AndreB is offline Senior Member
    Join Date
    Dec 2009
    Location
    Stuttgart, Germany
    Posts
    114
    Rep Power
    0

    Default

    And don't forget to dispose it!

    all your problems are discussed here I think:
    eclipse.org/articles/Article-SWT-images/graphics-resources.html

    so bad, I haven't 20 posts yet; I hope its okay to post that link

Similar Threads

  1. Creating a label with an image
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-11-2008, 04:40 PM
  2. Creating a caret (using an image) in SWT
    By Java Tip in forum SWT
    Replies: 0
    Last Post: 07-02-2008, 07:51 PM
  3. creating image using java
    By mmahesh_mca in forum New To Java
    Replies: 1
    Last Post: 04-26-2008, 11:23 PM
  4. Replies: 0
    Last Post: 01-08-2008, 05:29 PM
  5. creating an image button when using struts
    By yuchuang in forum Web Frameworks
    Replies: 1
    Last Post: 05-03-2007, 04:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •