JTextPane

It's supposed to have functions to set individual section of text to specific color/font/size/wieght etc. Do I have to grab the document from it before I can do that? Because JOptionPane.setForeground(Color) is setting the color for the entire JTextPane.
[262 byte] By [Vagabona] at [2007-11-26 23:54:35]
# 1
I believe JTextPane.setParagraphAttributes is what you're after, but I could be wrong, I've never actually used it.
hunter9000a at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 2
bah humbug, I'll look that method up. Sun's tutorial is rather generic on this topic and really doesn't cover JTextPane's special abilities, it just says it has them.Ah, AttributeSet's bah humbug.
Vagabona at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 3

That method takes an AttributeSet, which has color, font, etc attributes. The part I'm not sure about is where it talks about setting the "current paragraph" attributes. I'm not sure if that refers to an arbitrary block of text like you need, or a traditional separate-indented-block-of-text paragraph.

hunter9000a at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 4
Only one way to find out. Test it yourself or ask someone. No wait thats two, test it yourself, ask someone, or give up. No no wait, that's three. Suprise, fear, ruthless effeciants, and fanatical devotion to the pope...
Vagabona at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 5
One of these days I'll secure some funding to study whether being a java programmer makes you like Monty Python, or if being a Monty Python fan makes you inclined to become a java programmer. =)
hunter9000a at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 6
lol, I think it's mainly just being male makes you like monty python. Then again, wouldn't python programmers like it too?
Vagabona at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 7
And I just noticed a spelling error, Grhh, supid forum software, whats with not being able to edit old posts.
Vagabona at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 8
> And I just noticed a spelling error, Grhh, supid> forum software, whats with not being able to edit old> posts.To avoid revisionist history.You can edit old posts - if they havent been replied to.
TuringPesta at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 9

> > And I just noticed a spelling error, Grhh, supid

> > forum software, whats with not being able to edit

> old

> > posts.

>

> To avoid revisionist history.

> You can edit old posts - if they havent been replied

> to.

bah, as long as they haven't been quoted it should be okay...

Vagabona at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 10
> bah, as long as they haven't been quoted it should be okay...Almost correct.If I reply to you, even if I didn't quote you, your post would still become unmodifiable.Just a minor nitpick. :)
KathyMcDonnella at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 11
I was saying that it should be allowed as long as you ahven't been quoted
Vagabona at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 12
Ah, I see what you mean now.You mean you wish that the forum software behaves differently than it does now.Got it. :)
KathyMcDonnella at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 13
> Ah, I see what you mean now.> You mean you wish that the forum software behaves> like a normal ******* forum.> > Got it. :)
hunter9000a at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 14

Personally though, I actually prefer that only the most recent

message is modifiable. Often times, a message is based on

multiple previous messages, but those messages change from

under them, and the whole thread doesn't make sense any more.

Another personal forum wish list: mod points (like slashdot),

so people can mod up/down comments. So we can mod down trolls.

And by default, messages whose levels are < some threshold will not show,

so that newbies won't get mislead by trolls.

KathyMcDonnella at 2007-7-11 15:36:59 > top of Java-index,Java Essentials,New To Java...
# 15
lol, have you ever noticed, that if someones comment is edited by the filtering software, you can quote it and see what they said?
Vagabona at 2007-7-21 19:33:32 > top of Java-index,Java Essentials,New To Java...
# 16

Oh, and speaking of strange forum bugs, I think I just figured out why i n g is censored. I censored myself in my last post, by writing **** i n g. They probably added i n g to the list so that if you censored the bad part of a word yourself but left the i n g, the forum would censor the rest. Doesn't make a lot of sense to me, but then again, neither does tv shows censoring god, but leaving ****.

hunter9000a at 2007-7-21 19:33:32 > top of Java-index,Java Essentials,New To Java...
# 17

> Doesn't make

> a lot of sense to me, but then again, neither does tv

> shows censoring god, but leaving ****.

I know what you mean, I've heard it on the radio, ruins Panic! At the Disco's I Write Sins Not Tragedies. That and they also edit out ***** and replace it with Shhhh!

Vagabona at 2007-7-21 19:33:32 > top of Java-index,Java Essentials,New To Java...