getStyle name in JtextPane at caretPosition
I'm developing word processor, i succeeded to set the Style to the selected text in JTextPane. But i'm not able to get the set Style to the text when the caret is positioned before element or char or when we select the Text.
This string was set BOLD and this string ITALIC. now if i move caret position to before or after B it should say char set Bold, same way if i move caret position before or after I (Italic), it should say char set to Italic
code snippet would help me lot.
Many thanks in advance.