F
Francois LE DORNER
Hello,
1) I assign a document style by
style = myDefaultStyledDocument.addStyle("myStyle" , null);
StyleConstants.setAlignment(style, 1); //1 for center
myDefaultStyledDocument.setLogicalStyle(pos, style);
2) Then, I try to read the style :
AttributeSet attributeSet = myDefaultStyledDocument.getAttributes();
Enumeration attrEnum = attributeSet.getAttributeNames();
while ( attrEnum.hasMoreElements() ) {
Object attrObj = attrEnum.nextElement();
System.err.println("attrObj:"+attrObj.getClass());
}
I read only classes of StyleConstants.ResolveAttribute!...
Strange no ?
For all other StyleConstants that's ok !!
Is there something special to do with Alignment ?
1) I assign a document style by
style = myDefaultStyledDocument.addStyle("myStyle" , null);
StyleConstants.setAlignment(style, 1); //1 for center
myDefaultStyledDocument.setLogicalStyle(pos, style);
2) Then, I try to read the style :
AttributeSet attributeSet = myDefaultStyledDocument.getAttributes();
Enumeration attrEnum = attributeSet.getAttributeNames();
while ( attrEnum.hasMoreElements() ) {
Object attrObj = attrEnum.nextElement();
System.err.println("attrObj:"+attrObj.getClass());
}
I read only classes of StyleConstants.ResolveAttribute!...
Strange no ?
For all other StyleConstants that's ok !!
Is there something special to do with Alignment ?