Html in JEditor pane (again)

I know there are already loads of posts about this on the site (and I have hunted through them), but my problem is (I hope) different.
I am trying to take an html string which was created by transforming some xml using xsl and setting it in a JEditorPane.
I do the standard
_MessageArea.setContentType("text/html");
_MessageArea.setText(sMsg);where _MessageArea is the editor pane and sMsg is the string of the html.
When I do getText() on the pane though I get
<paragraph>
  <head>
  </head>
  <body>
    <p>
    </p>
  </body>
</paragraph>My only guess is this has something to do with the new lines (hex 0D0A) produced by the xsl mapping which are after most of the tags?
thanks
for any help!

The problem is that when I do
setText(sMsg)
sMsg=
<html><body><div align="left"><table border="0" width="680"><tr><td width="320">TO:</td>
<td width="340">WILLS SECURITIES EUROPE LTD</td>
</tr>
<tr><td width="320">ATTN:</td>
<td width="340"> </td>
</tr>
<tr><td width="320">FAX#:</td>
<td width="340">90081355122800</td>
</tr>
<tr><td width="320">FROM:</td>
<td width="340">XXXXX ASSET MANAGEMENT INTL LTD</td>
</tr>
</table>
</div>
<p>  </p>
<div align="left"><table border="0" width="680"><tr><td colspan="2"><b><p align="center">PURCHASE (SALE) ADVICE</p>
</b>
</td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Function of message</td>
<td width="340">NEW</td>
</tr>
<tr><td width="320">Transaction reference</td>
<td width="340">0061055</td>
</tr>
<tr><td width="320">Related transaction number</td>
<td width="340"> </td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Trade Date</td>
<td width="340">20020612</td>
</tr>
<tr><td width="320">Settlement Date</td>
<td width="340">20020612</td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Safekeeping account</td>
<td width="340">Safe4</td>
</tr>
<tr><td width="320">Place of safekeeping</td>
<td width="340"> </td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Security Identification</td>
<td width="340">JP3336600006</td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Quantity of shares</td>
<td width="340">5000.000000</td>
</tr>
<tr><td width="320">Price</td>
<td width="340">JPY5500.0000000000</td>
</tr>
<tr><td width="320">Gross Consideration</td>
<td width="340">JPY27500000.0000</td>
</tr>
<tr><td width="320">Commission</td>
<td width="340">JPY68750.0000</td>
</tr>
<tr><td width="320">Stamp Tax</td>
<td width="340">JPY0.0000</td>
</tr>
<tr><td width="320">Local fees</td>
<td width="340">JPY0.0000</td>
</tr>
<tr><td width="320">Other fees</td>
<td width="340">JPY0.0000</td>
</tr>
<tr><td width="320">Charges</td>
<td width="340">JPY0.0000</td>
</tr>
<tr><td width="320">Accrued Interest</td>
<td width="340">JPY0.0000</td>
</tr>
<tr><td width="320">Net consideration</td>
<td width="340">JPY27500000.0000</td>
</tr>
<tr><td width="320">FX instructed</td>
<td width="340"> </td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Deliverer / receiver</td>
<td width="340">DAIWA SECURITIES</td>
</tr>
<tr><td width="320">CSD account number</td>
<td width="340"> </td>
</tr>
<tr><td width="320">Beneficiary</td>
<td width="340">DAIWA SEC SMBC E</td>
</tr>
<tr><td width="320">Account number</td>
<td width="340"> </td>
</tr>
<tr><td width="320">Further beneficiary</td>
<td width="340"> </td>
</tr>
<tr><td width="320">Account Number</td>
<td width="340"> </td>
</tr>
<tr><td width="320">Further beneficiary</td>
<td width="340"> </td>
</tr>
<tr><td width="320">Account Number</td>
<td width="340"> </td>
</tr>
<tr><td width="320">Place of settlement</td>
<td width="340"> </td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td width="320">Additional Information</td>
<td width="340"> </td>
</tr>
<tr><td width="320"> </td>
<td width="340"> </td>
</tr>
<tr><td colspan="2">Best Regards</td>
</tr>
</table>
</div>
</body>
</html>but when I do getText() I get the paragraph nonsense!

Similar Messages

  • Issue with JEditor Pane

    Hello,
    I am trying to set a html page(which is converted from MS Word ) to a jeditorpane.The page loads fine but the hyperlinks doesn't work,they dont redirect to the appropriate topic.Its just a single page.It works fine as an individual html page but not with JEditorPane.
    Any clues,
    thanks
    Sree.

    sreecs wrote:
    The links are just table of contents in a MS Word.
    Coming from MS Word, I wonder if it's some flavor of non-standard HTML.then they shouldn't work in a standard html page too..why only when in a jeditor pane??
    thanks,
    Sree
    Edited by: sreecs on Nov 11, 2008 3:52 PMActually, MS Word-generated HTML often works fine in browsers, especially Internet Explorer. But everybody knows that it generates garbage for HTML (at least it used to, don't know about Office 2007). Browsers often go to great lengths to "get the gist" of non-compliant HTML and still render it properly (again, especially IE, which has been a criticism of web standards folks forever).
    JEditorPane has very simplistic HTML rendering support, and probably doesn't take much stuff that is non-standard. While it wasn't your problem, I am sure you could use pretty easily use Word to generate HTML that JEditorPane couldn't render properly.

  • Jeditor pane cut, copy, paste

    I have an applet using jeditor panes. when you right click a popup shows and you can choose to cut, copy, paste, select all. I use the functions copy, cut, paste, selectAll which jeditorpane inherits. This works properly in java 1.3X but in java 1.41 it is not working. Is there cliboard communication problems with java 1.41?

    Hi dhhyde,
    If you are having issues with your cutting, copying and pasting items from your iPad, you may want to try some things to troubleshoot.
    First, quit all running applications and test again -
    iOS: Force an app to close
    Next, I would try restarting the iPad -
    Turn your iOS device off and on (restart) and reset
    If the issue is still present, you may want to restore the iPad as a new device -
    How to erase your iOS device and then set it up as a new device or restore it from backups
    Thanks for using Apple Support Communities.
    Best,
    Brett L  

  • JEditor pane does not look like the explorer.

    Hi
    I would like to display the following htmlc ode on JEditor pane.
    I want to have two lists of assets and a title to each one.
    the problem is that one of the titles (the second one) does not displayed in the same location as the first one (It displayes ans if it is part of the list)
    I copies the code to a htm page and it looks fine on my explorer.
    I will be happy if you will tell me what is wrong in the html code.
    thanks
    Liat
    JEditorPane summeryMessagePane;
    summeryMessagePane=new JEditorPane("text/html","");
    //html string
    String text="<html><body><font face = Verdana size =2 color=black>The following files were defined successfully:<li><font face = Verdana size =2 color=black>/LDRS/mummy2_opt8_pal_2500kbps_10m_l2_ar128kbps.m1s.mpg</font></li><li><font face = Verdana size =2 color=black>/LDRS/nely_opt2_10m_pal_1860kbps_l2_128kps.m1s.mpg</font></li><br>The definition for the following files failed:<li><font face = Verdana size =2 color=black>/LDRS/mummy2_opt8_pal_2500kbps_10m_l2_ar128kbps.m1s.mpg.meta</font></li><font face = Verdana size =2 color=black>Unsupported asset format.<li><font face = Verdana size =2 color=black>/LDRS/nely_opt2_10m_pal_1860kbps_l2_128kps.m1s.mpg.meta</font></li><font face = Verdana size =2 color=black>Unsupported asset format.</font></body></html>"
    //set the string
    summeryMessagePane.setText(text.toString());
    JScrollPane scrollPane = new JScrollPane(summeryMessagePane);
            add(scrollPane,BorderLayout.CENTER);

    What ever gave you the idea that HTML display on JEditorPane would look exactly like in IE?
    JEditorPane only supports HTML 3.2 (but no frames, I think), some CSS 1 and no Javascript. It's very far from being useful for displaying modern web pages.
    Furthermore....
    <font face = Verdana size =2 color=black>
    Bad bad bad bad bad HTML format. You are supposed to always quote tag attribute values:
    <font face="Verdana" size="2" color="black">

  • ANYONE CAN HELP IN JEDITOR PANE!!Help

    I am displaying the HTML form inthe Jeditor Pane..It is working,but the only problem now is when i embed flash inside HTML ,it output shown symbol ??\How to overcome this

    Thanks DR>CLAP for ur solution,Do u have any alternative plan for this

  • Appending HTML in JEditor/JTextPane (25 dukes)

    HI:
    Is there any way i can append HTML in JEditor/JTextPane,
    as i gets the html data in chunks, so i want to append the html in the existing display in editorpane instead of refreshing it all time, which causes it to flicker,
    Thanks in advance.

    JEditorPane edit = new JEditorPane();
    edit.setEditorKit(new HTMLEditorKit());
    edit.setEditable(true);
    edit.setText("<HTML><b>test<b></HTML>");
    HTMLDocument doc=(HTMLDocument)edit.getDocument();
    try {
    doc.insertString(6,"new text",null);
    catch (Exception ex) {}
    see also other methods of HTMLDocument
    best regards
    Stas

  • JEditor Pane & Html links

    Hello! I'm using a JEditorpane to display a HTML page but i'm experiencing the following problem:
    * I'm using images as links but link fonctionality only appears in some parts of the image, not all over it.
    I create the html code in a String :
    String code ="<a href=""><img ...></img></a>";
    and then
    jEditorPane.setText(code);
    Do you know what is happening??
    thanks!

    I used JTextPane, and it worked correctly, the only headache was Java's HTML rendering engine, which sucks.
    Anyway, try a code like this:
    JTextPane pa=new JTextPane();
    JScrollPane scroller=new JScrollPane(pa);
    TheComponentYouWantToDisplayTheRenderer.add(scroller);
    pa.setEditable(false);
    pa.setEditorKit(pa.createEditorKitForContentType("text/html"));
    // Here you can set the page you want to display
    // Unfortunately there is no progress meter,
    // you need to work around it...
    pa.setPage("http://java.sun.com/");If you want to follow links, you have to add a HyperlinkListener to the page, like this:
    pa.addHyperlinkListener(new Hyperactive());
    class Hyperactive implements HyperlinkListener {
         public void hyperlinkUpdate(HyperlinkEvent e) {
              if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
                   if (e.getSource()==null) return;
                   JEditorPane pane = (JEditorPane) e.getSource();
                   if (e instanceof HTMLFrameHyperlinkEvent) {
                        HTMLFrameHyperlinkEvent  evt = (HTMLFrameHyperlinkEvent)e;
                        HTMLDocument doc = (HTMLDocument)pane.getDocument();
                        doc.processHTMLFrameHyperlinkEvent(evt);
                   } else {
                        try {
                             pane.setPage(e.getURL());
                        } catch (Throwable t) {
                             //t.printStackTrace();
    }I found this code in one of the tutorials, but it was long ago, and I don't remember which was it... :-)
    After this, you shouldn't have problems. But not that the img tag doesn't need to be closed, so try
    <img src="imgsrc">
    instead of
    <img src="imgsrc"></img>

  • How to know size of HTML page set to Jeditor pane  for printing

    Hi,
    i have to print an HTML doc which may be more no of pages .... ,that is set to jeditorpane and this component will be sent to print method , there i have to decide whether page exists. To do so i have to know how many pages the html doc occupies . how can i know ??
    thanks in advance .......

    Hi,
    i have to print an HTML doc which may be more no of pages .... ,that is set to jeditorpane and this component will be sent to print method , there i have to decide whether page exists. To do so i have to know how many pages the html doc occupies . how can i know ??
    thanks in advance .......

  • Printing a HTML doc from a JEditor Pane

    I would like to print a HTML page from a JEditorPane. I've searched trhough the web, but haven't found any free libs yet... Does anybody have some tips?

    See
    JEditorPane.setPage(URL)
    once you've done that and its rendered you should be able to print by using my StandardPrint class. Search for StandardPrint.java on this site

  • JEditor Pane can shows HTML, and in AWT?

    Hello,
    I need to show a web page in a Frame, with hyperlinks. I have found that this is possible, and very easy in Swing, with a JEditorPane, but can I do this in AWT?
    Thank you.

    These are all in javax.swing.text or javax.swing.text.html packages, but an EditorKit extends to Object not to Component, JComponent, Container...
    Then these will not decrease speed. However, these could use a swing class :( but i don't think.
    If you see sources, they import java.awt or javax.swing.text.* but not javax.swing.*
    ( I didn't verify all class, then be careful )

  • Jeditor pane, html links opening external browers

    HI,
    i have serched the web for about half a day, i have a JEditorPane that loads a web page works fine,
    only i would really like for the links they click on to open the clients default file browser??
    so not even sure if this is the right forum as it has more to do with starting up applications?
    Thanks any links, i am sure it has been done, using somthing like Runtime? but now sure what to put in the argument.
    Thanks
    David

    i found this thread but it say it is only windows???If you follow the link to java world it shows you how to do it for other platforms as well.
    Is there any way to do this instandard java?I believen JDK6 has the Desktop API which will handle this otherwise your stuck with the hack above or a 3rd party package.

  • RoboHelp HTML 9 Search Pane Max results controls

    RoboHelp HTML 9 with WebHelp as output...
    I have a two part question. By default when our users do a search in compile dhelp, they see 10 search results per page. Is there a place in my RoboHelp interface where I can change that to larger number? I have found a line of code in a *.js file where it looks like I could manually change it, but would prefer not to have to do it that route in case that causes unintended hiccups elsewhere.
    var nMaxResult = 10 ; 
    Second part of my question is related to statement in release notes/new features notes for RoboHelp 9 that state users can control the max search results per page on-the-fly as they use the Search pane. This feature only applies to WebHelp or WebHelp Pro and my output is WebHelp. I can see a line of code for that feature in the whfform.htm file but nothing shows up like that in the Search pane within compiled help. Is this a bug or is there a control somewhere in RoboHelp project settings that allows me to enable that option for users? The last 2 lines below would seem to control this area. The Search pane items referenced in first 4 lines do show up ok in my Search pane.
    gsTitle = "Type in the word(s) to search for:";
    gsTitle = "Type in the word(s) to search for:";
    gsHiliteSearchTitle = "Highlight search results";
    gsHiliteSearchTitle = "Highlight search results";
    gsMaxSearchTitle = "Search results per page" ;
    gsMaxSearchTitle = "Search results per page";
    Thanks for any insight you can provide,
    KF

    I know this is an old topic, but I was trying to figure this out myself today and finally found it. In case others have been looking for this, it's in in this file:
    whform.js
    find this variable:
    var gnMaxRslt = 10;
    and then change the 10 to the number you want.
    If you do that in the generated help, the number will change in the Search pane, but it will still display only 10 results. To get it to actually display more than 10 results, I had to edit the RoboHelp file, not the generated help. I made a copy of C:\Program Files (x86)\Adobe\Adobe RoboHelp 10\RoboHTML\WebHelp5Ext\template_stock\whform.js before I edited it. (Right-click the file, click Copy, then right-click in the folder and click Paste. Edit the one that doesn't say Copy in the filename. Then if you want to back it out, delete the one you edited and remove Copy from the original.) If you have your project open in RoboHelp, close it, then reopen it so it can "grab" the new info.
    This ought to be in the WebHelp Setting dialog box on the Search pane.
    --Karla--

  • How do I create a Search window in a RoboHelp HTML 8 topic pane?

    I am working in RoboHelp HTML version 8 that is published as WebHelp. The system I am developing for has a search window as part of a skin that is available above the topic windows and is not always easily accessible. Can you create a search window to appear in individual help panes like they do in Microsoft Office Word 2007's Help? (to do this, can you use skins within each Help topic pane?)  Or can a link or a button be created within a help topic pane to bring up a search window as a popup? If so, can you give me high level steps to doing these tasks?  thanks.

    Hi,
    Although you can open RoboHelps search pane in a popup, the search function will not function. I guess the easiest is to use another tool for your search, one that you customize into what you need. On Peter's site, he uses a progam called zoomsearch, which you can also use for RoboHelp projects. See http://www.grainge.org/pages/authoring/zoomsearch/zoomsearch.htm
    Greet,
    Willam

  • Bad Preference Panes again...

    Seems like another preference issue...
    After updating to Mavericks 10.9.1, I get this when opening the Mail, Contacts, and Calendars pane:
    From what I understand, all new Macs are Intel based? Unless there's some strange new chipset I haven't heard of.
    And yes, I tried opening System Preferences in both 32 bit and 64 bit mode. Opening it in 32 bit mode causes it to quit and reopen in 64 bit mode.

    Mike_VZ wrote:
    Hello Bevross,
    I have remapped the path again for you.  Please retest and send me a message if you're still having any trouble.
    Thanks!
    I sure wish that an automated process for "remapping the path" was available, either via the web site, the In-Home Agent, or the STB menu itself!  It would sure save alot of frustration in the customer base!

  • JEditor pane does not  show applets

    HOW TO SET THE CONTENT TYPE OF THE EDITOR SO THAT IT CAN OPEN ALL
    INCLUDING APPLICATIONS AND GRAPHICS,
    IT OPENS RTF'S, HTML AND TEXT AND FILE LIST, AND EVEN WHEN SET TO IMAGE/GIF IT DOES NOT OPEN THAM

    that's true, applets are not displayed...
    Text, RTF and HTML files are displayed because the Editor Pane uses a specific 'Document' (i I remember well) to open them. To be able to display other kind of information, you could need to create your own Documents...
    vincent

Maybe you are looking for

  • Scan via Preview no longer working after Lion Upgrade

    After upgrading to Lion, I can no longer use Preview to scan a document from my Kodak ESP9.  I have a range of issues, but the most common is that after telling preview to look for networked scanners, and then selecting the Kodak, it open a box that

  • Incorporation of PNG files in the view

    Hello All, As an example let us consider that I want to make a very simple application that just displays a pre-existing PNG graphics file filling the window and a text area over it. How do I go about doing that? I assume the solution begins with mak

  • AVCHD edit in PE10 share to DVD or Blue Ray

    I am currently editing a project in AVCHD and plan on making DVD and BR discs.  Not all the people who want this footage have blue ray players or HD TVs.   The footage is of sporting events with lots of action and camera movement.    What I have foun

  • Idvd won't play in DVD player

    I created an Imovie and shared it with Idvd to burn. I choose a theme and burned the DVD with no troubles. The movie will play in my computer (without showing the theme from Idvd but playing the movie) but will not play in my home DVD player hooked t

  • Half the engines are not updating wanted to update Forefront Protection 2010 for Exchange Server to newest sevice pack

    Running forefront protection 2010 for exchange. The version of Exchange we are running is Exchange Server 2007 sp3 rollup 13. I am seeing that half our engines are not updating for forefront. Currently we are running version 10.1.0746 sp1 for Forefro