Hello

I'm working on simple text editor based on jTextPane i have no problem setting text color, size, font etc.

but i have no idea how to get attributes from selected paragraph.

i'v tried doing it by

myPane.getCharacterAttributes().getAttribute(key));

but what shoud be the key?

any help would be appreciated

Recommended Answers

All 3 Replies

jTextPanel has no getCharacterAttributes() method

yes, but jTextPane has :P

ah, my bad. how about you get the AttributeSet (getAttributes), and then find for attributes within the set instead of trying to guess what the keys are going to be?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.