Results 1 to 3 of 3

Thread: color. help me

  1. #1
    yehuda is offline Member
    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Default color. help me

    what sort of colors could i use on a applet using java.awt.Color?
    BLACK, GREEN, and YELLOW work but when i tried BROWN this happened
    Main.java:11: cannot find symbol
    symbol : variable BROWN
    location: class java.awt.Color
    g.setColor(Color.BROWN);
    ^

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,801
    Rep Power
    25

    Default

    what sort of colors could i use on a applet using java.awt.Color?
    Read the API doc for the Color class. It lists the predefined colors.

  3. #3
    Marcoita_88 is offline Member
    Join Date
    Aug 2011
    Location
    Italy
    Posts
    9
    Rep Power
    0

    Default

    You can try this:
    1) search the hex color of the brown you want.
    2) Instead of Color.BROWN, use new Color(0x******) and replace the '*' with the hex code.

Similar Threads

  1. RGB to Color Name
    By zit1343 in forum Advanced Java
    Replies: 12
    Last Post: 04-24-2011, 07:02 PM
  2. if (...) ... won't set color
    By livingdog in forum New To Java
    Replies: 6
    Last Post: 04-11-2010, 04:59 PM
  3. RGB from Color Name
    By winklerd in forum Advanced Java
    Replies: 5
    Last Post: 03-26-2010, 06:16 PM
  4. [COLOR="Navy"]execute .bat file in mysql [/COLOR]
    By msankar.ravi in forum Networking
    Replies: 0
    Last Post: 02-24-2010, 05:27 AM
  5. A bit of color!
    By tim in forum Java 2D
    Replies: 8
    Last Post: 02-12-2008, 12:57 AM

Posting Permissions

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