473,387 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

preserve line breaks in applet parameters


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?

Jan 28 '07 #1
1 3385
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

Jan 28 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff T. | last post by:
I have an applet that sizes itself to the size of the browser frame that it is running in. On IE the applet resizes upon dragging the frame divider. I'm having a problem with getting this...
3
by: Rick | last post by:
Hi, what I'd like to do is to use a java applet on my website. But it needs some information so I was thinking about giving parameters when the applet starts. But is this possible? When I try...
0
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ...
0
by: gen_www | last post by:
I am running an applet in Internet Explorer using <Object> tag and trying to attach to it using Netbeans IDE. However Netbeans is not able to attach to the applet. However I can use Netbeans to...
4
by: timwap | last post by:
I hava a Java Applet that produces a DTMF tone at a certain time of day. There are 4 parameters to the Applet, they are hour = Hour of triggered event 00~23 min = minute of triggered event 00~59...
3
by: Dimitris \(GIS\) | last post by:
Hi I am a JavaScript rookie. I have an applet and want to change it's parameters with multiple links in my page. How can I do it? this is my code: <applet code="GIS.class"> <param...
0
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ...
1
by: ponvijaya | last post by:
Hi All, In My project, i am loading an applet in a HTML page using applet tag. And I am passing parameters to applet while loading the applet. In this project , this applet will do...
1
by: sheephead86 | last post by:
Hi, I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.