public Style addStyle(String nm,Style parent){
  StyleContext styles=(StyleContext)getAttributeContext();
  return styles.addStyle(nm,parent);
}

public Style addStyle ( String nm , Style parent ) { StyleContext styles = ( StyleContext ) getAttributeContext ( ) ; return styles . addStyle ( nm , parent ) ; }
adds a new style into the logical style hierarchy . style attributes resolve from bottom up so an attribute specified in a child will override an attribute specified in the parent .
