Here you can find the source of isCentered(AttributeSet attributes)
public static boolean isCentered(AttributeSet attributes)
//package com.java2s; //License from project: Apache License import javax.swing.text.AttributeSet; import javax.swing.text.StyleConstants; public class Main { protected static final String ALIGN_CENTER = "align-center"; public static boolean isCentered(AttributeSet attributes) { if (attributes != null) { if (attributes.getAttribute(StyleConstants.Alignment) != null) { Integer value = (Integer) attributes .getAttribute(StyleConstants.Alignment); if (value == StyleConstants.ALIGN_CENTER) { return true; }/* w w w .ja v a 2 s . co m*/ } } return false; } }