Click here to get back home

preserve line breaks in applet parameters

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
preserve line breaks in applet parameters www.douglassdavis.com 01-27-2007
Get Chitika Premium
Posted by www.douglassdavis.com on January 27, 2007, 10:10 pm
Please log in for more thread options



it seems every time i pass some text through an applet parameter, say:

...
<PARAM name="mytext" value='
This
is
a
test
'>
...


when i get the String, and print it out in the console window, it
never has the line breaks there. Is there any way I can preserve the
line breaks so that they are represented the same way they are in the
HTML?

If so, can some one explain exactly how?


Posted by Toby Inkster on January 28, 2007, 5:49 am
Please log in for more thread options


www.douglassdavis.com wrote:

> when i get the String, and print it out in the console window, it
> never has the line breaks there. Is there any way I can preserve the
> line breaks so that they are represented the same way they are in the
> HTML?

Probably not -- or rather, not consistantly across different browsers. It
is the browser that parses the PARAM element, not the Java engine. The
browser will use its normal rules for parsing attribute values, which in
many browsers will treat any extent of (horizontal or vertical) whitespace
as being equivalent to a single space character.

Try something like:

        <PARAM name="mytext" value='|This|is|a|test|'>

and then using a regular expression (or such) in Java to replace '|'
chracters with '\n'.

Followups set to the Java groups for someone to post some example regular
expressions. (I would, but I can't remember how/if they work in Java.)

--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact


Similar ThreadsPosted
DIV without line breaks June 22, 2005, 4:37 pm
IE7 Display:BLock and line breaks March 27, 2008, 2:41 pm
Thai text rendering issue in browser (line breaks) March 10, 2005, 5:38 pm
applet vs. object. vs embed? August 14, 2006, 11:08 am
java applet alternate text March 2, 2007, 11:34 am
run Java applet with from HTML April 27, 2007, 8:37 am
Java applet building tool - new version January 18, 2005, 8:06 am
Loading picture before the using java applet / progress bar or waiting message ? October 8, 2004, 12:05 am
preserve POST data when using the back-button September 13, 2006, 8:14 pm
Parameters of July 19, 2005, 12:51 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap