HTMLEditorKit.insertHTML() splits existing tag

Hi guys!
I try to create a simple editor with a JEditorPane, but when it comes to formating the HTML content, there's a little problem. ATM I use this way to insert a formatted text:
HTMLDocument html = (HTMLDocument) editorPane.getDocument();
HTMLEditorKit kit = (HTMLEditorKit) editorPane.getEditorKit();
try {
    String s = "<strong>�+html.getText(start, end - start)+�</strong>�;
    // remove old, change to bold
    html.remove(start, end - start);
    kit.insertHTML(html, start, s, 0, 0, HTML.Tag.STRONG);
} catch (BadLocationException e1) {
    e1.printStackTrace();
} catch (IOException e1) {
    e1.printStackTrace();
}But when I try to insert another format inside of the previously created STRONG tag, the HTMLEditorKit splits up the old tags, closing it, inserting the new tag and after the newly isnerted tag it opens up the old STRONG again.
Can someone please help me with this? It think it's just a small thinking mistake I make, but I can't figure out how to insert a tag inside another tag...
thanks in forward

Sorry for the long gap between my postings. I'm kinda busy these days.
I tried to use the parameters, but when I change the code from
HTMLDocument html = (HTMLDocument) editorPane.getDocument();
HTMLEditorKit kit = (HTMLEditorKit) editorPane.getEditorKit();
try {
  String s = "<strong>"+html.getText(start, end - start)+"</strong>";
  // remove old, change to bold
  html.remove(start, end - start);
  kit.insertHTML(html, start, s, 0, 0, HTML.Tag.STRONG);
} catch (BadLocationException e1) {
  e1.printStackTrace();
} catch (IOException e1) {
  e1.printStackTrace();
}into
  kit.insertHTML(html, start, s, 1, 1, HTML.Tag.STRONG);a NullPointerException is generated. Can you help me to interpret the API docs for those parameters? I don't have a clue how to insert a bold text into a sentence.
I tried with a sentence without any formatting and with a EM tag surrounding the whole sentence.

Similar Messages

  • XSLT Mapping Error - Split-MappingRoot-Tag missing

    Hi,
    I am getting "Split-MappingRoot-Tag missing" Error while using XSLT mapping. I am using 3 mappings in one Operation Mapping.
    1)  Java Mapping 2) Message Mapping 3) XSLT Mapping.
    When I have these mappings in a BPM one after another it is working fine.
    But ,if I put these mappings one after another in one Operation mapping it is giving problem after message mapping is complete.
    I tried to remove XSLT mapping and Msg Mapping is producing correct output which can be used as input for XSLT mapping.
    Any idea what could be the reason. Any hep is appreciated.
    ERROR
      <SAP:Code area="MAPPING">GENERIC</SAP:Code>
      <SAP:P1>Split-Mapping</SAP:P1>
      <SAP:P2>Root-Tag missing</SAP:P2>
      <SAP:P3 />
      <SAP:P4 />
      <SAP:AdditionalText />
      <SAP:Stack>Split-MappingRoot-Tag missing</SAP:Stack>
      <SAP:Retry>M</SAP:Retry>
    Is there any chance XSLT mapping starting before message mapping is complete
    Regards,
    Ramesh

    Thank you for your response.
    I tried to put XSL in the following format by adding that namespace. but it still giving same error.
    <?xml version="1.0"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
    Code ---
    </xsl:stylesheet>
    Also I itried to put Java mapping before XSLT mapping to see what payload is coming to XSLT.
    I am getting payload as:
    <?xml version="1.0" encoding="UTF-8"?> <ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge"><ns0:Message1>
    XML Payload Data --
    </ns0:Message1></ns0:Messages>
    Any one knows how to fix this issue? appreciate your inputs
    Regards,
    Ramesh

  • Price control cannot be changed (cost control split exist)

    Hi FI Experts,
    When changing the  price control field in material master through MM02 from "V" to "S" , the following message is displayed.
    "Price control cannot be changed (cost control split exist)".
    What should i do to avoid this?
    Regards,
    Sudarshan

    Hi Sudharshan,
    Before changeing the Price Control from V to S please check the Moving Price and Std.Price is equal or not.
    This is one of the reason for that.
    Pleease assign points
    regards,
    Gopi.

  • Building JSF tag using existing Tags

    Hi all
    I wonder if it's possible to create a new JSF tag using existing JSF Tags?
    For example, I have a JSF tag which renders a lable and a textinputfield, let's call it <f:field>
    Now I want to build a new JSF tag, which will re-use the existing tag <f:field>. IS it possible?
    Thanks in advance

    Did you have a chance to look at facelets solution. Facelets provide several approach how to create composition components.
    Sergey : https://ajax4jsf.dev.java.net

  • What is popDepth and pushDepth in HTMLEditorKit.insertHTML

    Hi,
    does anyone know what int popDepth and int pushDepth in HTMLEditorKit.insertHTML do?
    I found out (try & error) that I have to use 0 if the carret is placed in the middle of a paragraph and that I have to use 1 if the carret is placed at the first position of a paragraph.
    What is the right value for the first position in the first paragraph? 0 does nothing and 1 does some very strange thinks...
    Can anyone help me?
    Thank you,
    J&ouml;rn

    I have worked that this is a result of an HTMLEditorKit.InsertHTML command. Any ideas?

  • Splitting existing account into multiple IDs.

    We currently have 1 Adobe ID that is used for multiple CS5.5 subscriptions. How do you split existing subscriptions from a single ID so that each one has its own ID? I know I could simply create a new ID for each subscription but then I am only eligible for 1 lower cost subscription.

    With Creative Cloud Membership you would need to create multiple Adobe ID's (each billed separately) or you may want to consider the Team Ready (not available yet) option depending on how many individual memberships you have.
    http://www.adobe.com/products/creativesuite/companies.html

  • HTMLEditorKit adds spaces and tags.  Can I make it stop?

    I've developed an application that scores boat races and outputs the results in very compact HTML. One way to keep the HTML compact is to make tactical decisions about what tags to leave out, such as "</td>".
    Another is to put in virtually no white space unless it is part of the end user's display.
    This is all well and good when I save directly to the disk. But if I first display the string as HTML in a JEditorPane, it seems that the HTMLEditorKit wants to reformat the document, adding all the missing tags and a bunch of spaces and returns as well. THe prettier document is now twice the size (28k vs 14k). This is without me having made any editing changes.
    I can, of course save the original string directly, but I would like to give users the ability to edit before saving. Is there some sort of "don't make changes I did not ask for" fix to this item?

    I don't know of any easy way to do what you want with JEditorPane
    There are some packages that do HTML formatting for you. For example, you might be able to use JTidy (I've never tried it) to format the text before saving it. It has different options which you may be able to use to control the level of formatting.
    Or if you want full control over formatting, you could try using the ParserCallback class. It parses a text string and notifies you every time it finds a tag or attributes. You could then simply format the tag and attributes in the format you want. This example might get you started:
    import java.io.*;
    import java.net.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import javax.swing.text.html.parser.*;
    public class ParserCallbackTest extends HTMLEditorKit.ParserCallback
         private int tabLevel = 1;
         public void handleComment(char[] data, int pos)
              displayData(new String(data));
         public void handleEndOfLineString(String eol)
         public void handleEndTag(HTML.Tag tag, int pos)
              tabLevel--;
              displayData("/" + tag);
         public void handleError(String errorMsg, int pos)
              displayData(pos + ":" + errorMsg);
         public void handleMutableTag(HTML.Tag tag, MutableAttributeSet a, int pos)
              displayData("mutable:" + tag + ": " + pos + ": " + a);
         public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet a, int pos)
              displayData( tag + "::" + a );
    //          tabLevel++;
         public void handleStartTag(HTML.Tag tag, MutableAttributeSet a, int pos)
              displayData( tag + ":" + a );
              tabLevel++;
         public void handleText(char[] data, int pos)
              displayData( new String(data) );
         private void displayData(String text)
              for (int i = 0; i < tabLevel; i++)
                   System.out.print("\t");
              System.out.println(text);
         public static void main(String[] args)
         throws IOException
              ParserCallbackTest parser = new ParserCallbackTest();
              // args[0] is the file to parse
              Reader reader = new FileReader(args[0]);
    //          URLConnection conn = new URL(args[0]).openConnection();
    //          Reader reader = new InputStreamReader(conn.getInputStream());
              try
                   new ParserDelegator().parse(reader, parser, true);
              catch (IOException e)
                   System.out.println(e);
    }You can use a StringReader class as the input to the parser.

  • How to auto split existing projects in Aperture 3?

    Hi, I would like to batch split my existing projects in aperture 3 (latest version) so they're all split with one date of pictures in them, and I would also really like to name all of them by the date that the pictures were taken. Like for example, I have an album that's named "Album 1" and it has dates from July 24th-August 17, and I would like to have an individual album or project for every date, and also for the new split albums to be named by the date of the photos inside of it. How do I do this? Thank you!

    Hi,
       Sorry, I can't help you there - I suspect it may be an Applescript job, but don't know Applescript myself.
    Thinking about it some more, you could do it sort-of manually by first creating a new Project then searching all Projects for images falling within a set date range. You then select all the images returned by that search and drag them to your new Project.  Rename the Project accordingly, and rinse, lather, repeat. 
    This approach will be viable only if you have a limited number of images across not too big a date range.  Trying this on a big collection will do your head in.
    I understand what you want to do now, but still don't understand why.

  • JEditorPane - HTMLEditorKit - insertHTML

    Hi
    I have a JEditorPane set up to work with HTML. I want to be able to insert HTML text such as <B>This is a test</B> based on the current caret position. I'm able to do this with reasonable success with the insertHTML(...) method in HTMLEditorKit. The only problem occurs when I am on a new paragraph and want to insert the test HTML. I find that it always moves back onto the end of the previous paragraph unless I enter some text on the new paragraph which is annoying. Has anyone else being able to solve this problem and if so how?
    BTW I am able to use the insertAfterEnd(...) method from HTMLDocument and this works in this situation of the new empty paragraph but unfortunately that means if you want to insert in the middle of some text content it will end up being placed at the end of that content :-(
    Thanks in advance for any help

    Hi there,
    you can use HTMLEditorKit.read instead of insertHTML for the specific purpose of inserting HTML code at a given caharcter position. To insert HTML code before or after elements, I'd rather recommend insertBefore../insertAfter... as you already mentioned.
    HTH
    Ulrich

  • EasyTAG crapping out on modifying existing tags

    I have had this weird problem for some time, but since it only popped up with a few music files I didn't bother. Now I am cleaning out my collection and making the tags look more uniform (yes I know, I'm neurotic) and it happens with like every two files. I first thought it was due to the SSHFS share I was running EasyTAG on, but that can't be it - the exact same files make it crap out when I try to tag them locally. I'm running a 32 bit Arch install, synced with current, in perfect working order (at least I hope ).
    Also noteworthy (I think) is the fact I can edit those same files perfectly in Thunar (with the media plugin). So it looks definitely like an EasyTAG issue to me, but I'd like to have confirmation (and pointers) before I go bugging upstream .
    Anyway, I ran EasyTAG from a console, and I got this beauty:
    [stijn@hermes ~]$ easytag
    *** glibc detected *** easytag: double free or corruption (fasttop): 0x08a6fe78 ***
    ======= Backtrace: =========
    /lib/libc.so.6[0xb75e9a44]
    /lib/libc.so.6(cfree+0x9c)[0xb75eb3cc]
    /usr/lib/libglib-2.0.so.0(g_free+0x36)[0xb7a043f6]
    /usr/lib/libgobject-2.0.so.0[0xb7aadac6]
    /usr/lib/libgobject-2.0.so.0(g_value_unset+0x38)[0xb7aa9188]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7d6378a]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_list_store_set_valist+0xdd)[0xb7d64f6d]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_list_store_set+0x1f)[0xb7d64fef]
    easytag[0x808fcab]
    easytag[0x808e2e3]
    easytag[0x808a048]
    easytag[0x80847c8]
    easytag[0x80795b8]
    easytag[0x80798a3]
    easytag[0x807a7bb]
    easytag[0x807aac4]
    easytag[0x807ab32]
    /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x84)[0xb7a95174]
    /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b3)[0xb7a87b03]
    /usr/lib/libgobject-2.0.so.0[0xb7a9af3d]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x804)[0xb7a9c474]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x26)[0xb7a9c8d6]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7c775f5]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_action_activate+0x84)[0xb7c785d4]
    /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x84)[0xb7a95174]
    /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b3)[0xb7a87b03]
    /usr/lib/libgobject-2.0.so.0[0xb7a9af3d]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x804)[0xb7a9c474]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit_by_name+0x17d)[0xb7a9c77d]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7e49bd7]
    /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x84)[0xb7a95174]
    /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b3)[0xb7a87b03]
    /usr/lib/libgobject-2.0.so.0[0xb7a9af3d]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x804)[0xb7a9c474]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x26)[0xb7a9c8d6]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_button_clicked+0x8a)[0xb7c8fc5a]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7c90e30]
    /usr/lib/libgobject-2.0.so.0(g_cclosure_marshal_VOID__VOID+0x84)[0xb7a95174]
    /usr/lib/libgobject-2.0.so.0[0xb7a86279]
    /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b3)[0xb7a87b03]
    /usr/lib/libgobject-2.0.so.0[0xb7a9a776]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x804)[0xb7a9c474]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x26)[0xb7a9c8d6]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_button_released+0x8a)[0xb7c8fcfa]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7c8fd33]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7d6dc46]
    /usr/lib/libgobject-2.0.so.0[0xb7a86279]
    /usr/lib/libgobject-2.0.so.0(g_closure_invoke+0x1b3)[0xb7a87b03]
    /usr/lib/libgobject-2.0.so.0[0xb7a9abc5]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit_valist+0x68b)[0xb7a9c2fb]
    /usr/lib/libgobject-2.0.so.0(g_signal_emit+0x26)[0xb7a9c8d6]
    /usr/lib/libgtk-x11-2.0.so.0[0xb7e9601e]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_propagate_event+0xea)[0xb7d668aa]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_main_do_event+0x2ef)[0xb7d67baf]
    /usr/lib/libgdk-x11-2.0.so.0[0xb7bdb61a]
    /usr/lib/libglib-2.0.so.0(g_main_context_dispatch+0x1f1)[0xb79fc171]
    /usr/lib/libglib-2.0.so.0[0xb79ff803]
    /usr/lib/libglib-2.0.so.0(g_main_loop_run+0x1d2)[0xb79ffd22]
    /usr/lib/libgtk-x11-2.0.so.0(gtk_main+0xb9)[0xb7d680d9]
    easytag[0x8081fe0]
    /lib/libc.so.6(__libc_start_main+0xe5)[0xb75945c5]
    easytag(_ZNSt8ios_base4InitD1Ev+0x79)[0x8054b41]
    ======= Memory map: ========
    08048000-080e4000 r-xp 00000000 08:05 153411 /usr/bin/easytag
    080e4000-080ee000 rwxp 0009b000 08:05 153411 /usr/bin/easytag
    080ee000-08184000 rwxp 080ee000 00:00 0
    08593000-08b25000 rwxp 08593000 00:00 0 [heap]
    b6a00000-b6a21000 rwxp b6a00000 00:00 0
    b6a21000-b6b00000 ---p b6a21000 00:00 0
    b6b77000-b6b86000 r-xp 00000000 08:05 24409 /lib/libbz2.so.1.0.4
    b6b86000-b6b87000 rwxp 0000f000 08:05 24409 /lib/libbz2.so.1.0.4
    b6b87000-b6cb9000 r-xp 00000000 08:05 149551 /usr/lib/libxml2.so.2.6.32
    b6cb9000-b6cbe000 rwxp 00131000 08:05 149551 /usr/lib/libxml2.so.2.6.32
    b6cbe000-b6cbf000 rwxp b6cbe000 00:00 0
    b6cbf000-b6cf1000 r-xp 00000000 08:05 151596 /usr/lib/libcroco-0.6.so.3.0.1
    b6cf1000-b6cf4000 rwxp 00031000 08:05 151596 /usr/lib/libcroco-0.6.so.3.0.1
    b6cf4000-b6d24000 r-xp 00000000 08:05 190709 /usr/lib/libgsf-1.so.114.0.8
    b6d24000-b6d27000 rwxp 0002f000 08:05 190709 /usr/lib/libgsf-1.so.114.0.8
    b6d27000-b6d28000 rwxp b6d27000 00:00 0
    b6d28000-b6d87000 r-xp 00000000 08:05 147379 /usr/lib/libgio-2.0.so.0.0.0
    b6d87000-b6d89000 rwxp 0005e000 08:05 147379 /usr/lib/libgio-2.0.so.0.0.0
    b6d89000-b6db9000 r-xp 00000000 08:05 190712 /usr/lib/librsvg-2.so.2.22.2
    b6db9000-b6dba000 rwxp 00030000 08:05 190712 /usr/lib/librsvg-2.so.2.22.2
    b6dcd000-b6dcf000 r-xp 00000000 08:05 60026 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
    b6dcf000-b6dd0000 rwxp 00001000 08:05 60026 /usr/lib/pango/1.6.0/modules/pango-basic-fc.so
    b6dd0000-b6de1000 r-xp 00000000 08:05 229676 /usr/share/fonts/TTF/Vera.ttf
    b6de1000-b6df1000 r-xs 00000000 08:06 21176 /var/cache/fontconfig/8d4af663993b81a124ee82e610bb31f9-x86.cache-2
    b6df1000-b6df7000 r-xs 00000000 08:06 20935 /var/cache/fontconfig/d62e99ef547d1d24cdb1bd22ec1a2976-x86.cache-2
    b6df7000-b6e02000 r-xs 00000000 08:06 20933 /var/cache/fontconfig/f6b893a7224233d96cb72fd88691c0b4-x86.cache-2
    b6e02000-b6e42000 r-xs 00000000 08:06 20932 /var/cache/fontconfig/17090aa38d5c6f09fb8c5c354938f1d7-x86.cache-2
    b6e42000-b6e44000 r-xs 00000000 08:07 502971 /home/stijn/.fontconfig/1e60231fbbeaa8f9d2a088a4cc3889fd-x86.cache-2
    b6e45000-b7080000 r-xp 00000000 08:05 211994 /usr/share/icons/hicolor/icon-theme.cache
    b7080000-b708a000 r-xp 00000000 08:05 155059 /usr/share/locale/nl/LC_MESSAGES/glib20.mo
    b708a000-b70ea000 rwxs 00000000 00:07 5570564 /SYSV00000000 (deleted)
    b70ea000-b70fc000 r-xp 00000000 08:05 214628 /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
    b70fc000-b70fd000 rwxp 00012000 08:05 214628 /usr/lib/gtk-2.0/2.10.0/engines/libmurrine.so
    b70fd000-b711e000 r-xp 00000000 08:05 154588 /usr/share/locale/nl/LC_MESSAGES/libc.mo
    b711e000-b7141000 r-xp 00000000 08:05 156750 /usr/share/locale/nl/LC_MESSAGES/gtk20-properties.mo
    b7141000-b714a000 r-xp 00000000 08:05 25106 /lib/libnss_files-2.8.so
    b714a000-b714c000 rwxp 00008000 08:05 25106 /lib/libnss_files-2.8.so
    b7151000-b715f000 r-xp 00000000 08:05 157133 /usr/share/locale/nl/LC_MESSAGES/easytag.mo
    b715f000-b716f000 r-xp 00000000 08:05 156749 /usr/share/locale/nl/LC_MESSAGES/gtk20.mo
    b716f000-b72ab000 r-xp 00000000 08:05 154963 /usr/lib/locale/locale-archive
    b72ab000-b72bb000 r-xp 00000000 08:05 42149 /usr/lib/gconv/libGB.so
    b72bb000-b72bd000 rwxp 0000f000 08:05 42149 /usr/lib/gconv/libGB.so
    b72bd000-b72bf000 rwxp b72bd000 00:00 0
    b72bf000-b72c3000 r-xp 00000000 08:05 150802 /usr/lib/libXdmcp.so.6.0.0
    b72c3000-b72c4000 rwxp 00003000 08:05 150802 /usr/lib/libXdmcp.so.6.0.0
    b72c4000-b72c6000 r-xp 00000000 08:05 150800 /usr/lib/libXau.so.6.0.0
    b72c6000-b72c7000 rwxp 00001000 08:05 150800 /usr/lib/libXau.so.6.0.0
    b72c7000-b72c8000 rwxp b72c7000 00:00 0
    b72c8000-b72e6000 r-xp 00000000 08:05 150785 /usr/lib/libexpat.so.1.5.2
    b72e6000-b72e8000 rwxp 0001e000 08:05 150785 /usr/lib/libexpat.so.1.5.2
    b72e8000-b72ff000 r-xp 00000000 08:05 150893 /usr/lAfgebroken
    Not sure if that
    /usr/lib/libFLAC.so.8(FLAC__metadata_chain_delete+0x3b)[0xb773f59b]
    has something to do with it, but that was at least the action I was hoping to perform .
    As said, pointers are welcome .
    Edit: W00t, 900th post
    Last edited by B (2008-08-31 23:51:37)

    I checked as I promised, but it more looks like I'm mistaken. Easytag works, at least now, as it should. I haven't tested it with all formats yet, but this far I don't get any strange output.
    Sorry for not being of any real help.
    Last edited by KimTjik (2008-09-06 22:53:12)

  • How to add attribute to already existing tag?

    Hello!
    Could you help me, please. I need to add attribute maxlegth to <h:inputTextarea>, but I don't know how to do it. Maybe, you know?

    <textarea> don't support maxlength by spec. You can use JavaScript instead.
    Or if you really want to create a custom component with this attribute added, check following tuts:
    http://www.jsftutorials.net/components/index.html
    http://www-128.ibm.com/developerworks/java/library/j-jsf4/
    http://java.sun.com/javaee/javaserverfaces/customcomponents.html

  • How can i create and paste my own tags into source page of a html editor

    I download ekit and try to customize.
    I wrote a similar code:
    TagEditor extends HTML
    , and inner class:
    ExtendedTag extends Tag
    by following similar structure with javax.swing.text.html
    I added my own tags into tagList in HTMLUtilities class which is in com.hexidec.ekit.component. Because it is initialized three times when i run the program.
    I add a button to multitoolbar, and wrote a insertMyTag method in class EkitCore:
    private void insertMyTag() throws IOException, BadLocationException, RuntimeException {
    int caretPos = jtpMain.getCaretPosition();
    // htmlKit.insertHTML(htmlDoc, caretPos, "<VAZIFE>", 0, 0, TagEditor.ExtendedTag.VAZIFE);
    jtpMain.setText("<HTML><BODY><VAZIFE></BODY></HTML>");
    jtpSource.setText(jtpMain.getText());
    jtpMain.setText does display in the source editor but the default HTMLEditorKit creates the unkown tags and inserts them into the html view output with box-like borders. I want to keep the tags in the source but remove them from the output view so the user only sees the normal HTML output and my app sees the XML tags.
    What do I need to do in insertMyTag to turn off the strange display of
    unknown tags? Is there an easier way to do this?
    Thanks

    Or, take a ScreenHunter image of the list and email that to yourself.

  • MARQUEE behaviour into a HTMLEditorKit

    I was developing an application which needs scroolling text like a marquee. For a simple implementation I had thougt to include a MARQUEE TAG :
    JEditorPane values =new JEditorPane();
    values.setBorder(BorderFactory.createLineBorder(Color.black,1));
    values.setPreferredSize(new Dimension(80,30));
    values.setMinimumSize(new Dimension(80,30));
    values.setBackground(Color.yellow);
    HTMLEditorKit htmlKit = new HTMLEditorKit();
             values.setEditorKit(htmlKit);
             BufferedReader in = new BufferedReader(
                            new StringReader(
                                 "<HTML><TITLE>The Title</TITLE>"+
                  "<BODY><I>italics</I><MARQUEE WIDTH=100% BGColor=yellow>This is an example of an alternating marquee...</MARQUEE></BODY></HTML>"));
              try{
                  htmlKit.read(in, values.getDocument(),0);
             }catch (Exception e){
              }I can see the italics text but the marquee text is static into the box assigned to this component.

    Hello,
    try this:
    doc.insertBeforeStart(doc.getParagraphElement(editor.getCaretPosition()), imageName);But in HTML, an image is not a paragraph, it is a "character")
    then you should try:
    doc.insertBeforeStart(doc.getParagraphElement(editor.getCaretPosition()), "<p>" + imageName + "</p>");HTMLEditorKit.insertHTML() have bugs when you insert paragraphs : a table is a paragragh, but this method insert it as a character !
    Use one of these method (these are sure) (in jdk version > 1.3):
    HTMLDocument.insertBeforeStart()
    HTMLDocument.insertAfterEnd()
    HTMLDocument.insertAfterStart()
    HTMLDocument.insertBeforeEnd()
    HTMLDocument.setInner()
    HTMLDocument.setOut()

  • Better tagging support in Forum (like in LabVIEW-Gr​oups)

    I find it difficult to add the same tag to a message as I did some time ago. I often look up in my "Top Tags" page.
    In a discussion in a group of the community (example: https://decibel.ni.com/content/thread/15792) this is much easier. Existing tags of any user are proposed while typing. So it is much easier to reuse existing tags. And tag clouds of the NI forum would show clearer results.
    This would at least partially fulfil this suggestion: Split the label "UI & Usability" ...

    Here's a link to meta discussions on the design and implementation of the gold-standard tagging enging -- and agreed that AJAXy typeahead is one of the more important features to help grow the tagging ecosystem for LabVIEW. Tagging makes the internet a smaller place :-)
    a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"] {color: black;} a.lia-user-name-link[href="/t5/user/viewprofilepage/user-id/88938"]:after {content: '';} .jrd-sig {height: 80px; overflow: visible;} .jrd-sig-deploy {float:left; opacity:0.2;} .jrd-sig-img {float:right; opacity:0.2;} .jrd-sig-img:hover {opacity:0.8;} .jrd-sig-deploy:hover {opacity:0.8;}

  • HTMLEditorKit HTMLFactory

    I download ekit and try to customize.
    I wrote a similar code:
    TagEditor extends HTML
    , and inner class:
    ExtendedTag extends Tag
    by following similar structure with javax.swing.text.html
    I added my own tags into tagList in HTMLUtilities class which is in com.hexidec.ekit.component. Because it is initialized three times when program runs.
    I added a button to multitoolbar, and wrote a insertMyTag method in class EkitCore:
    private void insertMyTag() throws IOException, BadLocationException, RuntimeException {
    int caretPos = jtpMain.getCaretPosition();
    // htmlKit.insertHTML(htmlDoc, caretPos, "<VAZIFE>", 0, 0, TagEditor.ExtendedTag.VAZIFE);
    jtpMain.setText("<HTML><BODY><VAZIFE></BODY></HTML>");
    jtpSource.setText(jtpMain.getText());
    jtpMain.setText does display in the source editor but the default HTMLEditorKit creates the unkown tags and inserts them into the html view output with box-like borders. I want to keep the tags in the source but remove them from the output view so the user only sees the normal HTML output and my app sees the XML tags.
    What do I need to do in insertMyTag to turn off the strange display of
    unknown tags?
    Thanks

    I am using Blackdown JDK and not SUN JDK, so should I
    report it to Blackdown?
    blink, blink, blink
    Yes, you should report the problem to the people who are responsible for and/or have the power to fix it.

Maybe you are looking for

  • My iTouch was stolen and I can't seem to get the passcode off.

    About six months ago my iPod Touch was stolen, but my teacher returned it to me when she found it in the classroom. The person that had stolen it syned it to their computer and now I can't get the passcode off is there anyway I can get it off and res

  • How  to handle table controls in BDC

    Hi All, Can u please help me out in my BDC program which involves header data and the item data which is to be filled in a Table Control of a particular transaction .If anyone can send me already existing code it would be of great help.. Thanks in Ad

  • Audio out question?

    I just got in my G5 DP 2.7 and this thing is sweet. Now with that said, on to the question. I have a pair of Yorkville Studio monitors that I want to connect to my G5. The Yorkvilles have XLR inputs on them and they are Bi-amped. I do not want to go

  • A table "CMP3$111448" appears in DB replicating a big table and spending a lot of space in database

    We have a web application which manages digital documents, its main table is named "DOC_ADJUNTO", this table has a column "DOCUMENTO" of type BLOB and some other columns. Also there is an Oracle Text Index for the BLOB column of the table "DOC_ADJUNT

  • Reset button Acrobat 9

    I add a reset button in a PDF Form. Through PC work fine but when I try to use in my iPad through Adobe Reader doesn't work. I already check any possible update for the app, iPad software, etc. I add another button for Submit Form through email and w