tags:

views:

108

answers:

1

I am using a JEditorPane to display a series of links in response to a user query. The user can then click on these links to be taken to the original file or web page.

This works just fine when the number of links is relatively small. However, when there is a lot of text in the JEditorPane, instead of displaying the nicely formatted links, it displays the html, like:

<html>
    <body>
        <a href="http://www.link.com"&gt;My Link</a>
        ...
    </body>
</html>

Has anyone seen this behavior before? Any idea how I might go about fixing it? It seems to only happen sometimes (i.e. sometimes with the same query I get the links, sometimes I get raw HTML).

Thanks

A: 

I would guess that the HTML is not being created correctly. Maybe you don't update the editor pane on the Event Dispatch Thread which is causing the problem.

camickr
We are updating the editor pane on the EDT. After some further testing, it seems that the length of the results is not the issue. We haven't found any way to predict this behavior, and sometimes the same query will yield the HTML dump one time and the links another.
Ambuoroko