• Post Reply Bookmark Topic Watch Topic
  • New Topic

Anchor tags in JEditorPane  RSS feed

 
sasi kala
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi everybody,

My doubt is regarding JEdiotorPane. JEditorPane setPage() method is working fine for hyperlinks which are pointing to another html files. but my requirement is to prepare online help. It will contain links to another paragraph of the same html file. Traversing to a link pointing to the same page is not working fine with HyperlinkListener. Whenever hyperlink is clicked it was reloading the same page and did not scroll to the required paragraph.

My question is how to add hyperlink listener to editorpane where the hyperlinks are pointed to another paragraph of the same page

I have tryed in several ways to solve it, but I didn�t get the right answer.
If any one know the answer please help me.

Regards,
sasi
[ March 17, 2005: Message edited by: sasi kala ]
 
sasi kala
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

i got the answer for my problem from java team and the problem is

In my test html file target positions are marked with :
<a id='xyz'> </a>


Swing-html does not support 'id'. (it supports html3.2)


Target positions in the document are to be marked with :
<a name='xyz'> </a>

after changing "id" with "name", my code is working correctly as i need.

regards,
sasi
[ March 22, 2005: Message edited by: sasi kala ]
 
Steve Wood
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem, but was wondering how you actually reference the section on your page.

I'm using:

<a href="#myitem">Go to bookmark</a>

and then at the target location

<a name="myitem">My Item</a>

But it doesn't seem to work. Any hints would be most appreciated.

Cheers,

Steve
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!