swing - styled document - paragraph attribute  
Author Message
francoisledorner





PostPosted: 2005-3-8 21:14:00 Top

java-programmer, swing - styled document - paragraph attribute 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 ?

FLD