swing - styled document - paragraph attribute

Discussion in 'Java' started by Francois LE DORNER, Mar 8, 2005.

  1. 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
     
    Francois LE DORNER, Mar 8, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    667
    Steven Cheng[MSFT]
    Aug 16, 2005
  2. Tom Davies
    Replies:
    0
    Views:
    522
    Tom Davies
    Oct 9, 2004
  3. Søren Jacobsen

    Padding in css-styled button, ie6

    Søren Jacobsen, Oct 17, 2003, in forum: HTML
    Replies:
    2
    Views:
    1,496
    Søren Jacobsen
    Oct 20, 2003
  4. wizard of oz

    Abstract Styled Document and undo

    wizard of oz, May 22, 2008, in forum: Java
    Replies:
    0
    Views:
    348
    wizard of oz
    May 22, 2008
  5. dorayme
    Replies:
    112
    Views:
    2,748
    dorayme
    Mar 30, 2009
Loading...

Share This Page