JAVA Question - color coded text / JTextArea?

Superwormy

Golden Member
Feb 7, 2001
1,637
0
0
I want to make a simple HTML editor, can anyone give me a starting point on this with Java?

I know how to make a JTextArea for simple plain-text editing... but is there a good way to go about color-coding the text? Tokenizers or...?
 

DannyBoy

Diamond Member
Nov 27, 2002
8,820
2
81
www.danj.me
Why make one?

There are plenty of good free ones.

Of course, if you have another reason, then i wont stop you.
 

CTho9305

Elite Member
Jul 26, 2000
9,214
1
81
Originally posted by: DannyBoy
Why make one?

There are plenty of good free ones.

Of course, if you have another reason, then i wont stop you.

There are lots of hello world programs, there are lots of sorting algorithms available online, there are lots of linked list implementations, a lot of maze solving programs... you have to rewrite stuff to learn. Sometimes you have to rewrite more complex stuff to learn too, and sometimes a program that exactly implements the feature set you want just doesn't exist.
 

Superwormy

Golden Member
Feb 7, 2001
1,637
0
0
OK... so does anyone actually have an answer for me?


It's for fun, the fun of LEARNING STUFF, as CTTho9305 pointed out, learning by experience is A GOOD THING. Hence the reason I'm doing it.
 

DannyBoy

Diamond Member
Nov 27, 2002
8,820
2
81
www.danj.me
Originally posted by: Superwormy
OK... so does anyone actually have an answer for me?


It's for fun, the fun of LEARNING STUFF, as CTTho9305 pointed out, learning by experience is A GOOD THING. Hence the reason I'm doing it.

Ok i SEE WHAT YOU MEAN.

If you want my help try not to BE SO DAMNED RUDE.
 

Punamo

Senior member
Jan 28, 2001
302
0
0
If you have installed the jdk, look in the dir yourJdkDir\demo\jfc\Stylepad. The source files that sets the color (and font properties) of the stylepad demo is Wonderland.java. It uses Style interface, DefaultStyledDocument class, and some misc classes to create the formatted document.
 

eklass

Golden Member
Mar 19, 2001
1,218
0
0
Originally posted by: DannyBoy
Why make one? There are plenty of good free ones. Of course, if you have another reason, then i wont stop you.

Score -5 Flamebait

don't be a dirtbag