title: Java Enum Static Final Instance Variables
body: <p>Huzzah!</p>
  
  <p>This code worked for a time, then I decided to add a default color, and it stopped working.  I get the following error:</p>
  
  <pre><code>1 error found:
  File: Status.java  [line: 20]
  Error: Status.java:20: illegal reference to static field from initializer
  </code></pre>
  
  <p>With the following code at compile-time.</p>
  
  <pre><code>import java.awt.Color;
  
  enum Status
  {
    OFF ("Off"),
    TRAINING ("Training", new Color(255, 191, 128)),
    BEGINNER ("Beginner", new Color(128, 255, 138)),
    INTERMEDIATE ("Intermediate", new Color(128, 212, 255)),
    ADVANCED ("Advanced", new Color(255, 128, 128));
  
    public final String name;
    public final Color color;
  
    public static final Color defaultColor = Color.WHITE;
  
    Status(String name)
    {
      this(name, defaultColor);
    }
    Status(String name, Color color)
    {
      this.name = name;
      this.color = color;
    }
  }
  </code></pre>
  
  <p>This should work, as far as I can tell, but for whatever reason Java decided to throw an error.
  Any thoughts?</p>