Re: Emoticon text parser



On Thu, 20 Mar 2008 10:40:39 -0700, Karsten Wutzke <kwutzke@xxxxxx> wrote:

how do I write a text parser that will detect many ":-)", "]:->"
strings so that they can be replaced with small icons a text
component?

That all depends on how you're formatting the text to include the icons.

But, for example, if you're using HTML in one of the Swing controls that can display HTML, you might just use the java.util.regex package useful. Just use it to do a straight search-and-replace of emoticon strings with the appropriate HTML "img" tag.

Other than that, your question is pretty broadly worded. You're either going to get a lot of replies that aren't applicable, or none at all due to the vagueness of the problem description.

Pete
.



Relevant Pages

  • Re: efficiency of JList setElementAt()
    ... If you modify your program to produce strings about 3 times as long, make the strings HTML with a font color tag, and increase the list size to about 130, I think you'll get the kind of results I cited in my first post. ... The Swing cell renderer design is based on assumptions that construction is expensive and updating values is cheap. ... So let's cache. ...
    (comp.lang.java.gui)
  • Re: Best way to dump HTML strings to a page in ASP.Net?
    ... of HTML as strings into a string builder. ... HTML as text into a string builder. ... longer work, this only happens with a high number of strings being ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Another Drop List question
    ... If your database field is set to not allow zero-length strings, ... > ASP code and HTML and for me, it makes it easier to line up my quotes. ...
    (microsoft.public.inetserver.asp.general)
  • Re: Best way to dump HTML strings to a page in ASP.Net?
    ... limitations for query strings or hidden fields than other browers... ... form method is POST so it has more room to pass your data along. ... of HTML as strings into a string builder. ... HTML as text into a string builder. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: How to call HTML (with POST) page from Web form
    ... private mshtml.HTMLDocument ieDoc; ... //use the following for getting at HTML in the document. ... You can see I've wrapped the IE Navigate method just to check for null ... strings and other validations. ...
    (microsoft.public.dotnet.languages.csharp)