Anchor in JEditorPane is displayed as a space

C

Christian Marko

Hi to all!

I just have to display html-files. In these files anchors (like '<a
name="xyz"></a>') are defined. The problem is, that at these places a
space is displayed in the JEditorPane. As the anchors are defined in
front of a first line of a paragraph, this looks horrible.

In the JEditorPane it looks like the following:
my first line
my second line
my third line

Can anyone give me a hint, what i can do, to solve this problem?

thx
Chris
 
P

Paul Lutus

Christian said:
Hi to all!

I just have to display html-files. In these files anchors (like '<a
name="xyz"></a>') are defined. The problem is, that at these places a
space is displayed in the JEditorPane. As the anchors are defined in
front of a first line of a paragraph, this looks horrible.

In the JEditorPane it looks like the following:
my first line
my second line
my third line

Can anyone give me a hint, what i can do, to solve this problem?

Put the anchor at the end of the line, not the beginning.

Without seeing the actual, exact text that is in your JEditorPane, we can't
determine the actual cause. One possible reason is an extraneous space near
or within the tag.
 
C

Christian Marko

Paul Lutus said:
Put the anchor at the end of the line, not the beginning.

Putting the anchor to the beginning is not really a solution for my
case, because a get a user manual with a lot of html files and i
cannot change all files, moreover I have been told not to change the
files.
Without seeing the actual, exact text that is in your JEditorPane, we can't
determine the actual cause. One possible reason is an extraneous space near
or within the tag.

This a part of the html code, which is displayed:

<p class="Body"><a name="340391"></a>This guide contains many
important <span class="SpecialBold">warning and safety
instructions</span>, which have to be followed by the user. </p>
<p class="Body">

In the original page it looks like the following:

p class="Body">
<a name="340391"> </a> This guide contains many important <span
class="SpecialBold">warning and safety instructions</span>, which have
to be followed by the user. </p>
<p class="Body">

I thought, that maybe the space between <a..> and </a> or after </a>
causes this problem, but as you can see in the current changed version
of the html code, there is no space in there, but the problem also
occur.
 
A

Andrew Thompson

This a part of the html code, which is displayed:

<p class="Body"><a name="340391"></a>This guide contains many
important <span class="SpecialBold">warning and safety
instructions</span>, which have to be followed by the user. </p>
<p class="Body">

Have you validated your HTML? <http://validator.w3.org/>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.lensescapes.com/ Images that escape the mundane
 
A

Ann

Christian Marko said:
Paul Lutus <[email protected]> wrote in message

Putting the anchor to the beginning is not really a solution for my
case, because a get a user manual with a lot of html files and i
cannot change all files, moreover I have been told not to change the
files.


This a part of the html code, which is displayed:

<p class="Body"><a name="340391"></a>This guide contains many
important <span class="SpecialBold">warning and safety
instructions</span>, which have to be followed by the user. </p>
<p class="Body">

In the original page it looks like the following:

p class="Body">
<a name="340391"> </a> This guide contains many important <span
class="SpecialBold">warning and safety instructions</span>, which have
to be followed by the user. </p>
<p class="Body">

I thought, that maybe the space between <a..> and </a> or after </a>
causes this problem, but as you can see in the current changed version
of the html code, there is no space in there, but the problem also
occur.

try changing <p> to <br>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top