Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / January 2004

Tip: Looking for answers? Try searching our database.

jtextarea and html

Thread view: 
Christoff Pale - 06 Jan 2004 22:12 GMT
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 - 06 Jan 2004 23:41 GMT
> 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 - 07 Jan 2004 05:56 GMT
| 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

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Manolis Christodoulou - 07 Jan 2004 13:25 GMT
> | Hi,
> | Is it possible for me to setup up jtextarea such that
[quoted text clipped - 9 lines]
> _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 - 08 Jan 2004 05:59 GMT
| ..What is the problem?

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

--
Andrew Thompson
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Adam - 09 Jan 2004 07:35 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.