<html> inside JTextarea

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gaya3
    New Member
    • Aug 2007
    • 184

    <html> inside JTextarea

    Hi,
    can anyone please say me how to add <html> tags inside JTextarea?
    Thanks in Advance.

    -Thanks & Regards,
    Hamsa
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by gaya3
    Hi,
    can anyone please say me how to add <html> tags inside JTextarea?
    Thanks in Advance.

    -Thanks & Regards,
    Hamsa
    Use an editor pane instead.

    Comment

    • gaya3
      New Member
      • Aug 2007
      • 184

      #3
      Originally posted by r035198x
      Use an editor pane instead.

      Thank you.. if u dont mind can u please clear my following question..
      In JTextarea,I need to change the font colour for particular word or first word in that textarea.How is that possible? if i use as textarae.setFon t() means whole text in that textarea gets change rite?


      -Thanks & Regards,
      Hamsa

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by gaya3
        Thank you.. if u dont mind can u please clear my following question..
        In JTextarea,I need to change the font colour for particular word or first word in that textarea.How is that possible? if i use as textarae.setFon t() means whole text in that textarea gets change rite?


        -Thanks & Regards,
        Hamsa
        Yep right; a JTextArea is a simple widget: it uses one back/foreground colour
        for everything. As was suggested already you need a component that can handle
        StyledDocuments , in particular an HTML document. Read the API documentation.

        kind regards,

        Jos

        Comment

        Working...