if (a.isDefined(Foreground)) return (Color) a.getAttribute(Foreground);
Color c = (Color) a.getAttribute(Foreground); if (c != null) return c;
  public static Color getForeground(AttributeSet a)  {    if (a.isDefined(Foreground))      return (Color) a.getAttribute(Foreground);    else      return Color.BLACK;  } 