JTextArea with Different Fonts

Is there a way to have JTextArea with multiple fonts at different lines?

[79 byte] By [blackmagea] at [2007-11-27 10:52:54]
# 1

Check out this posting:

http://forum.java.sun.com/thread.jspa?threadID=5194753

camickra at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 2

How does that apply to JTextArea?

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 3

It doesn't. You just never replied to that posting so I figured you never bothered to read it. So I wasn't about to post a response here assuming you don't read and respond to your postings.

camickra at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 4

No, I read all the responses, and I either find a different way of doing things or take the advice of people say. Sorry if me not responding makes you think that I don't read it, but I do.

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 5

So you respond to every posting you make saying that the problem is solved (and you list the solution). People don't want to waste time reading and answering postings that already have a solution.

If the suggestion wasn't helpfull, then you say you are still looking for help.

Every posting should have a followup response by you.

camickra at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 6

Ok, got it.

So is there a way to do this?

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 7

Not with a JTextArea, but if you read the JTextArea API you will find a link to the Swing tutorial on "Using Text Components" that will show a component that you can use.

camickra at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 8

Ok, thnx

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 9

You don't have to reply to all threads you create and thank those that help you out of the goodness of their hearts. It's not required. But if you don't want to be thought of as an inconsiderate lout not taught basic manners by his mom, and not worthy of getting any help anymore, I'd recommend that you do this.

petes1234a at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 10

I don't consider it inconsiderate though. I help people(in life and in the forums from time to time) and don't get a thnx at all, and honeslty I don't expect me. Or that could just be the New York lifestyle coming out.

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 11

> I don't consider it inconsiderate though. I help

> people(in life and in the forums from time to time)

> and don't get a thnx at all, and honeslty I don't

> expect me. Or that could just be the New York

> lifestyle coming out.

Again, it's your choice. You want to piss off anyone who helps you, be my guest. It's a free country. But actions have consequences.

petes1234a at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 12

So there is JTextField, JTextArea and JEditorPane. TextArea is definitely not what I want, JEditorPane is mostly for webpages, JTextField doesn't differeante between the lines. Is there anythig else I can use yo have the text represented differently at each line?

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 13

> So there is JTextField, JTextArea and JEditorPane.

And....

I give up! The tutorial has pictures of 6 different text compnents.

camickra at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 14

Hey, I got it with JTextPane.

Thnx.

blackmagea at 2007-7-29 11:40:38 > top of Java-index,Desktop,Core GUI APIs...
# 15

But I do have one more question. Is there a TextArea with a linewrap that preserves the \n when the text is outputted into a document?

blackmagea at 2007-7-29 11:40:44 > top of Java-index,Desktop,Core GUI APIs...
# 16

> . Is there a TextArea with a linewrap that preserves the \n when the text is outputted into a document?

I thought you said you read your old postings:

http://forum.java.sun.com/thread.jspa?threadID=5195370

There is no "\n" added to the Document of the text area.

camickra at 2007-7-29 11:40:44 > top of Java-index,Desktop,Core GUI APIs...
# 17

In my old posting I was asking for JTextArea, in this one I was asking for any text area. But I guess not. Thnx again.

blackmagea at 2007-7-29 11:40:44 > top of Java-index,Desktop,Core GUI APIs...