Replacing substrings with images in GUI (parser)

Discussion in 'Java' started by Karsten Wutzke, Mar 19, 2008.

  1. Hello,

    I want to write a smiley parser which does no more than find smaller
    substrings in another and replaces those with some image displayed in
    some text component.

    Which class/es can you recommend?

    Do you perform the image replacement on Document level or on the text
    component level?

    Suggestions welcome!

    Karsten
     
    Karsten Wutzke, Mar 19, 2008
    #1
    1. Advertisements

  2. Karsten Wutzke wrote:
    > Hello,
    >
    > I want to write a smiley parser which does no more than find smaller
    > substrings in another and replaces those with some image displayed in
    > some text component.
    >
    > Which class/es can you recommend?
    >
    > Do you perform the image replacement on Document level or on the text
    > component level?
    >
    > Suggestions welcome!
    >
    > Karsten


    There are a couple of ways you could go about this. Create a font that
    has those characters in it or create a component that will display text
    and graphics. The JTextPane might work for what you want to do. I
    haven't played with that very much.

    --

    Knute Johnson
    email s/nospam/linux/

    --
    Posted via NewsDemon.com - Premium Uncensored Newsgroup Service
    ------->>>>>>http://www.NewsDem
     
    Knute Johnson, Mar 19, 2008
    #2
    1. Advertisements

  3. Karsten Wutzke

    Jeff Higgins Guest

    Karsten Wutzke wrote:
    > Hello,
    >
    > I want to write a smiley parser which does no more than find smaller
    > substrings in another and replaces those with some image displayed in
    > some text component.
    >
    > Which class/es can you recommend?
    >
    > Do you perform the image replacement on Document level or on the text
    > component level?
    >
    > Suggestions welcome!
    >


    Hi,
    I'm interested in reading more replies to your question as I'll soon
    be working on a similar problem. Right now I'm looking at:
    javax.swing.text.html.HTMLEditorKit.ParserCallback.
    <http://java.sun.com/javase/6/docs/api/javax/swing/text/html/HTMLEditorKit.ParserCallback.html>

    JH
     
    Jeff Higgins, Mar 20, 2008
    #3
  4. Karsten Wutzke

    Jeff Higgins Guest

    Jeff Higgins wrote:
    >
    > Karsten Wutzke wrote:
    >> Hello,
    >>
    >> I want to write a smiley parser which does no more than find smaller
    >> substrings in another and replaces those with some image displayed in
    >> some text component.
    >>
    >> Which class/es can you recommend?
    >>
    >> Do you perform the image replacement on Document level or on the text
    >> component level?
    >>
    >> Suggestions welcome!
    >>

    >
    > Hi,
    > I'm interested in reading more replies to your question as I'll soon
    > be working on a similar problem. Right now I'm looking at:
    > javax.swing.text.html.HTMLEditorKit.ParserCallback.
    > <http://java.sun.com/javase/6/docs/api/javax/swing/text/html/HTMLEditorKit.ParserCallback.html>
    >


    Ah! Just found this also:
    javax.swing.text.html.HTMLDocument.HTMLReader
    <http://java.sun.com/javase/6/docs/api/javax/swing/text/html/HTMLDocument.HTMLReader.html>

    JH
     
    Jeff Higgins, Mar 20, 2008
    #4
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bernd Oninger
    Replies:
    0
    Views:
    930
    Bernd Oninger
    Jun 9, 2004
  2. ZOCOR

    XML Parser VS HTML Parser

    ZOCOR, Oct 3, 2004, in forum: Java
    Replies:
    11
    Views:
    1,059
    Paul King
    Oct 5, 2004
  3. Will McGugan

    Replacing large number of substrings

    Will McGugan, Sep 4, 2005, in forum: Python
    Replies:
    3
    Views:
    431
    Michael J. Fromberger
    Sep 4, 2005
  4. amadain
    Replies:
    11
    Views:
    673
    Paul McGuire
    Feb 14, 2007
  5. Tung Chau
    Replies:
    1
    Views:
    578
    SM Ryan
    Aug 6, 2004
  6. Tung Chau
    Replies:
    0
    Views:
    463
    Tung Chau
    Aug 6, 2004
  7. DarthBob88

    Finding and Replacing Substrings In A String

    DarthBob88, Sep 23, 2007, in forum: C Programming
    Replies:
    7
    Views:
    713
    Keith Thompson
    Sep 23, 2007
  8. Rob Meade

    Replacing - and not Replacing...

    Rob Meade, Apr 5, 2005, in forum: ASP General
    Replies:
    5
    Views:
    557
    Chris Hohmann
    Apr 11, 2005
Loading...