swing - styled document - paragraph attribute

  • Thread starter Francois LE DORNER
  • Start date
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 ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top