jtextarea and html  
Author Message
christoff_pale





PostPosted: 2004-1-7 6:13:00 Top

java-programmer, jtextarea and html Hi,
Is it possible for me to setup up jtextarea such that
it renders html.
Suppose I create a but "interpret html" which when clicked
goes through the text in jtextarea and
adds styles
for example if I have something like
<b>bold text here</b>

then this should be bold. Furthermore, it should hide these html
tags but not delete them, that way when i save the text, i save the html
tags as well.

thanks for any advice
 
ak





PostPosted: 2004-1-7 7:41:00 Top

java-programmer >> jtextarea and html > Is it possible for me to setup up jtextarea such that
> it renders html.

no.

use JTextPane

____________

http://reader.imagero.com the best java image reader.


 
Andrew Thompson





PostPosted: 2004-1-7 13:56:00 Top

java-programmer >> jtextarea and html "Christoff Pale" <email***@***.com> wrote in message
news:email***@***.com...
| Hi,
| Is it possible for me to setup up jtextarea such that
| it renders html.

Short answer no. Long answer Nope.

If you subclassed JTextArea, you could add
the functionality, but that would not be a
JTextArea anymore.

OTOH - JTextPanes and JEditorPanes
_do_ style text, you would be better off
investigating them.

HTH


 
 
Manolis Christodoulou





PostPosted: 2004-1-7 21:25:00 Top

java-programmer >> jtextarea and html Andrew Thompson wrote:

> "Christoff Pale" <email***@***.com> wrote in message
> news:email***@***.com...
> | Hi,
> | Is it possible for me to setup up jtextarea such that
> | it renders html.
>
> Short answer no. Long answer Nope.
>
> If you subclassed JTextArea, you could add
> the functionality, but that would not be a
> JTextArea anymore.
>
> OTOH - JTextPanes and JEditorPanes
> _do_ style text, you would be better off
> investigating them.
>

I have the same problem, I want to display HTML formating text. I tried
JTextPane and JEditorPane myself. I placed them in a JFrame with
BorderLayout in the EAST side. But it seems that every time I try to
resize the window, the JTextPane or the JEditorPane cover all the JFrame
area. JTextArea works as expected. What is the problem?

 
 
Andrew Thompson





PostPosted: 2004-1-8 14:00:00 Top

java-programmer >> jtextarea and html "Manolis Christodoulou" <email***@***.com> wrote in message
news:email***@***.com...

| ..What is the problem?

What is the SSCCE?
http://www.physci.org/codes/sscce.jsp


 
 
Adam





PostPosted: 2004-1-9 15:35:00 Top

java-programmer >> jtextarea and html > I have the same problem, I want to display HTML formating text. I tried
> JTextPane and JEditorPane myself. I placed them in a JFrame with
> BorderLayout in the EAST side. But it seems that every time I try to
> resize the window, the JTextPane or the JEditorPane cover all the JFrame
> area. JTextArea works as expected. What is the problem?

Do you have anything else in that JFrame? If you dont then it behaves as
expected:
the component consumes all the space left.

Adam