Results 1 to 6 of 6
  1. #1
    phyzix5761 is offline Member
    Join Date
    Nov 2012
    Posts
    43
    Rep Power
    0

    Default Dynamic Multi-Colored Text

    Hey guys. I've been reading tutorials on JEditorPane and JTextPane but i can't figure out how to do what I want. I have a client and server chat program where I want the chatDisplay to appear in different colors. The chatDisplay gets appended every time an event happens such as someone joining or leaving or someone types something. How can I make this work?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Dynamic Multi-Colored Text

    Can you show what you've tried, preferably in a small compilable and runnable program? That way we'll all have something we can work with as a starting basis. Also what type of styled document are you using?

  3. #3
    phyzix5761 is offline Member
    Join Date
    Nov 2012
    Posts
    43
    Rep Power
    0

    Default Re: Dynamic Multi-Colored Text

    I haven't tried using styled document yet because I don't understand how it would work in my situation (where the chatDisplay needs to get updated with new information). I am currently using a JTextArea.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Dynamic Multi-Colored Text

    The tutorials have sample demo code that compiles and runs, I suggest that you start there as that's always a good place to start.

  5. #5
    phyzix5761 is offline Member
    Join Date
    Nov 2012
    Posts
    43
    Rep Power
    0

    Default Re: Dynamic Multi-Colored Text

    Which tutorials do you mean?

  6. #6
    DarrylBurke's Avatar
    DarrylBurke is online now Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,404
    Rep Power
    20

    Default Re: Dynamic Multi-Colored Text

    Quote Originally Posted by phyzix5761 View Post
    Which tutorials do you mean?
    The Java™ Tutorials

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 2
    Last Post: 11-20-2012, 09:24 PM
  2. colored text with System.out.println
    By novice in forum New To Java
    Replies: 4
    Last Post: 07-08-2011, 09:48 PM
  3. multi selection of text
    By joypik in forum New To Java
    Replies: 10
    Last Post: 06-27-2010, 08:45 AM
  4. Print multi-colored characters in a sentence
    By Jeff Smith in forum New To Java
    Replies: 1
    Last Post: 07-24-2009, 03:43 AM
  5. Replies: 2
    Last Post: 08-10-2007, 12:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •