Displaying Formatted Text Using AWT

The application I'm making has strict size limitations, so I need to stay away from Swing Components. I would like; however, to display segments of text in different fonts and colors and have them scroll up like a chat session. So far, all I've been able to find is Swing components that format HTML code. Is there an AWT component that will scroll upward, handle wordwrap, and display different font colors and styles?

There is no component in AWT that supports HTML tags....To do what you wanted to do, I ended up writing my own HTML parser, using a canvas and drawing the string (with HTML tags) myself. Click the link shown below and then click on any hyperlink to see the result (you can view the HTML page by right-clicking and selecting view source):
http://home.attbi.com/~aokabc/Dialog/Dialog.htm
Clicking Brief Documentation toward the bottom of the screen for info on the HTML tags that the parser is capable of handling. It may give you some idea of what's involved if you want to do something like this yourself.
V.V.

Similar Messages

  • Can I display formated text on a TextArea

    I am developing a chat applet. I want to display texts from chatters in a TextArea with specific colour and font. But TextArea only contain a method AppendText(String) where displaying plain text is only possible. Please anyone help me to display formatted text in a TextArea(or any relavent component).
    Thank you very much.

    You will probably want to look at JEditorPane instead.

  • How to display Formatted text in adobe form

    In adobe form, I want to display the text which is inputed by formatted text edit in WD ABAP application.
    It is always displayed as plain text like '<p>this is test text.</p>'. I have set the attribute Data Format to XHTML, Field Format to Rich Text for the Text Field in adobe form. But it doesn't work.
    How to display these formatted text?
    Thanks and Best Regards,
    Jun

    Hi Juergen,
    I found Your blog and found it  really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
    I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
    Some suggestion will be greatly appreciated.
    Thankyou
    Simone

  • Nested Table: How to display formatted text in the form ?

    Hi,
    Scenario:
    I have a nested table, say TAB1, containing another table TAB2 which holds the formatted text.
    Sample data
    Entries in TAB1:
    Column1       Column2(TAB2)
    Text1         Data_from_tab2
    Text2         Data_from_tab2
    Text3         Data_from_tab2
    Requirement:
    The requirement is to display the data in TAB1 as it is maintained.
    Trials:
    I am aware of the fact that we can transfer the content of the nested table (in this scenario, TAB2) in another table(of type TLINE) defined as a global variable in the interface of the form. Then in the context area, we can define a 'TEXT' node and bind it to the table and choose the 'Dynamic text' for the 'text type' attribute and maintain the other atrributes.
    But this approach cannot solve the issue as it is a nested table.
    Kindly suggest how can I resolve this issue.
    Regards
    s@k

    Hi,
    if its like colum1, column2 (tab2).
    you can represent column2 as a nested table in the form. and put these tables structure intoa subform of type flowed.
    then you can have the required format.
    the same can also be acheived using nested subforms instead of tables.
    example of such scenario is PO & line items.
    po number1 , items 1
                          item 2
                          item 3
    po number2 , items 1
                          item 2
                          item 3
    hope this helps you.
    Cheers,
    Sai

  • How to Display  Formatted Text  IN ALV Column?

    HI experts ,
    I am displaying  ALV with Multiple Column's , One of the Column is TEXT(Fomatted text).
    When ALV is Displayed  TEXT Column Comes as Continues TEXT . and is Not Formatted .
    Now when i want to edit this text i am Calling another View  which contains text edit . This Text edit will display correct Formatted Text . but when i save it and Come back to ALV again i do see continues text .
    Is there  any way where in i can display  the Formatted text in ALV Column ?
    Any body have any clue with this ...
    Thanks in Advance
    Patil
    Edited by: Badarinarayan Patil on Feb 22, 2008 3:45 PM

    Hi Juergen,
    I found Your blog and found it  really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
    I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
    Some suggestion will be greatly appreciated.
    Thankyou
    Simone

  • How to display Formatted text view in adobe forms

    Hi Folks,
    We have a element formatted text edit/view in webdynpro so it is easy to make the text formates(Bullets, font sizes, etc..) in webdynpro, but the same feature is not available in Adobe forms designer...I don't find any element in the Adobe Library...
    If any body have an idea how to display the formatted text in adobe, please let me know the procedure.
    I have a html tag related data in my Ztable..I want to display this converted string from HTML Tab on adobe, please explain me how to fix this issue.
    Thanks,
    Naresh.

    Hi Juergen,
    I found Your blog and found it  really interesting... though I was not able to use it: I (like Jun Li is asking, I guess) need to use a dynamic text, containing formatting informations (according the xhtml syntax).
    I tried to pass it to the form by an ABAP-dictionary based interface and by means of the context (in a webdynpro page), but both tries failed.
    Some suggestion will be greatly appreciated.
    Thankyou
    Simone

  • Help with displaying formated text

    I need some advice in displaying the results from my program. I recieve these results from a CGI program and then display it. I can format how the CGI outputs the text however I want, but in an attempt to make it look nice I have the CGI output html syntax and place my data in nice tables. This text I then send to a JEditorPanel and tell it the text type is html. But there are two problems. The first is, that the results look terrible. It places huge spaces between lines of text, the text is formated bad and at the beginning is the text "head", and "/head" inside of two boxes. The thing is though, if I view this same text straight in Netscape it looks great, but whatever HTML I send to the JEditorPanel looks terrible. Is there a way to improve its results or is there another , better thing to use than the JEditorPanel or a better way to use the JEditorPanel that will allow me to create a pretty, formated text output?

    This was an old post of mine and I don't remember exactly how I was trying to do it, but the problem was just something with the way I was setting up my JEditorPane.
    Now I declare it like this:
         javax.swing.JEditorPane ResultsDisplay = new javax.swing.JEditorPane();
         JScrollPane ResultsDisplayScrollPlane = new JScrollPane(ResultsDisplay);
         HTMLEditorKit htmlEdKit = new HTMLEditorKit();And I do this to set it up during initialization:
              ResultsDisplay.setEditable(false);
              ResultsDisplay.setEditorKit(htmlEdKit);
              ResultsDisplay.setContentType("text/html");
              ResultsDisplay.setEditorKitForContentType("text/html", htmlEdKit);and this during run time to display my HTML formated text:
                   Document doc = ResultsDisplay.getEditorKit().createDefaultDocument();
                   ResultsDisplay.setDocument(doc);
                   System.out.println(inputLine);
                   ResultsDisplay.setText(inputStore.toString());
                   getContentPane().validate();
                           getContentPane().repaint();some of this could be redundant, but it works.
    But are you sure you don't want the dukes? They're stuck to this question and I don't know what else to do with them

  • Display Formatting text

    How to display the formatted text from access memo field
    using coldfusion without loosing the formating of the text

    try wrapping it with <pre><pre />

  • Display formatted text

    How to display the formatted text from access memo field
    using coldfusion without loosing the formating of the text. Please
    help.

    user341975 wrote:
    > I tried it but it will not retain the formating. For
    example the following is
    > my content
    >
    > Application Phases:
    > ? Phase 1
    > ? Phase 11
    > ? Phase III
    >
    > I am saving it to access database. If i run access
    report, it exactly displays
    > like this but when i output the column value using
    cfoutput the i get the
    > following results
    >
    > Application Phases:? Phase 1? Phase 11? Phase III
    >
    > Thank you
    >
    You text is space formated. Normal HTML ignores multiple
    white spaces.
    That is why the <pre> & <code> tags exist.
    Put your output between
    <pre></pre> tags and you will get what you want.

  • How to display sample text using dynpage ?

    Hi All,
             I am developing the portal using dynpage technology.  I do not know whether I am posting this thread in the right place.
    How to display a sample text in the portal using dynpage?
    I have written it using HTMLFragment.  But it could not recognise the <> tags it seems.
    I am getting error in < and in \.  Can anyone pls help to resolve this?
    I tried with normal html tags.  It could not recognise the tags.
    Pls suggest.
    Regards,
    Subashini.
    Edited by: Subashini on Sep 16, 2008 7:48 AM

    Do read through this tutorial.
    http://help.sap.com/saphelp_nw70/helpdata/EN/95/cfa441cd47a209e10000000a155106/frameset.htm
    Thanks,
    GLM

  • How to -format text  in web dynpro?

    Hi all,
    I want to display text messages in web dynpro in different colors.
    and also to display some text in bold, some in italics etc
    How can i achieve that?
    Points assured for help?

    shobhendra,
    Direct support for rich-formatted text is not available in current release of WD Java (though it exists in NW04s WD ABAP).
    For workaround (HTML display) please refer my blog post:
    <a href="/people/valery.silaev/blog/2005/11/23/display-formatted-text-using-webdynpro-for-java">Display formatted text using WebDynpro for Java</a>
    Other post could be helpful as well if you experience problems with sizing IFrame used in solution above: <a href="/people/valery.silaev/blog/2006/07/14/escaping-the-procrustean-bed">Escaping the Procrustean bed</a>
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net

  • How to use formatted text in a static text/laben(or other) component?

    Hello everyone,
    my web application reads a VARCHAR from a SQL Server database which is bound to a static text/label component. The problem is that I don't manage to include line breaks this way.
    Is there any way to do it? It doesn't have to be using a static text or label component, I just want to display formatted text on a web page which was read from a database.
    Thank you very much for your help,
    Arthur

    unfortunately it doesn't work this way(or I am doing it wrong as I don't know anything about css)
    If I set white-space: nowrap the text is displayed in one single line ( so probably I implemented it the right way)
    but with white-space:pre he still ignores all the whitespaces!
    reading the same text (from a microsoft sql server table)with a textarea component all whitespaces and line breaks are shown! there has to be a way to make the static text or label component act this way(I don't want to use the textarea component because it's ugly and doesn't serve for my purpose).
    can anybody help me?
    edit: observation:
    if I use "nowrap" for the textarea component he still keeps all whitespaces WITHIN the string but displays the whole string in one line
    but somehow he deletes white spaces in the beginning of the string
    the static text/label components delete all whitespaces before AND within the string
    Edited by: Arthur... on Feb 15, 2008 9:34 AM

  • How to display long text in alv

    Hi ,
    I need to display the long text of particular object on ALV, with 30 char each line .
    I have long text in one internal table, master table have one to maany relation with longtext table and long text contains 120 character in each line.
    i need to display long text using 30 char in each line on alv. could you please suggest the soution ????
    format is like
    ponumber date         longtext 
        1234    03/04/05   this is PO is created
                                  for materail which have
                                  shortage in plant.

    hope u r expecting this..
    optimize = 'X'
    if u use OUTPUTLEN it is fixed size for that specific field, and also it reflects for next fields, to avoid that again have to mention OUTPUTLEN = 'X' for next field.
    With OPTIMIZE = 'X'  it will adjust based on the size.
    regards...
    santhosh reddy
    Message was edited by:
            Santhosh Reddy

  • Formatted text and smartforms/Adobe forms

    Hello all,
    can anybody please tell me if there is a way to display formatted text that was edited with FormattedTextEdit (or is there any other ui element that allows me to format text?) in smartforms/adobe forms with all formats? Also, is it possible to display graphics in the smartforms/adobe forms that was prior uploaded to the application server?
    Thanks and regards, Oliver

    Hi Raja,
    I implenented SAVE_TEXT AND READ_TEXT like you advised but the smartforms still doesn't show the text formats edited via BTF editor.  I even tried to convert it to ITF using "CONVERT_STREAM_TO_ITF_TEXT" but it wouldn't help either. For example the text
    <HTML><HEAD></HEAD> <BODY> <P>This is a test text in Times New Roman</P> <P><FONT face=Arial>This is a test text in Arial</FONT></P> <P><FONT face=Arial><STRONG>This is a test text in Arial and bold</STRONG></FONT></P></BODY></HTML>
    would exactly appear in this manner (using text element in smartforms) and not formatted. Do you any other ideas solving this issue?
    Thanks and regards, Oliver

  • Formatting text (bold, italics, etc) in webmail client does not work in Firefox; works in IE and Chrome

    I use the Smarsh webmail client for my company's email service.
    I have been using Firefox in the office for quite some time, and only recently has this issue come up.
    When composing emails using the Smarsh client, I cannot format text (using bold, italics, or underline) using the buttons built in to the client. When I highlight text and click a formatting button, the cursor just moves to the end of the line.
    Using keyboard shortcuts to edit the formatting works sometimes, but is sporadic (sometimes formatting PREVIOUSLY selected text but not the currently selected text).
    I have tried downgrading to Firefox 16, 17, and 18 (as this problem has only come up in the last couple of weeks, and Firefox 19 was release I believe on 2/13), but this did not solve the problem either.

    Many site issues can be caused by corrupt cookies or cache. In order to try to fix these problems, the first step is to clear both cookies and the cache.
    Note: ''This will temporarily log you out of all sites you're logged in to.''
    To clear cache and cookies do the following:
    #Go to Firefox > History > Clear recent history or (if no Firefox button is shown) go to Tools > Clear recent history.
    #Under "Time range to clear", select "Everything".
    #Now, click the arrow next to Details to toggle the Details list active.
    #From the details list, check ''Cache'' and ''Cookies'' and uncheck everything else.
    #Now click the ''Clear now'' button.
    Further information can be found in the [[Clear your cache, history and other personal information in Firefox]] article.
    Did this fix your problems? Please report back to us!

Maybe you are looking for