Page 1 of 2 12 LastLast
Results 1 to 20 of 40
  1. #1
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default change Text Colore

    Hi All

    How can i change the Foreground color of particullar text. I want to change the color of this.

    Java Code:
      String clientName ="";
     clientName = client.getInetAddress().getHostAddress();
    Can i do it? if yes then plz give me tips..

    Thxs in advance..

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  3. #3
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    What you mean foreground color of text? Text color?
    yes sir color of text...

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

  6. #6
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Basically you can use setForeground() on a label.
    Sir i know to set font on label ,button,text ect. But i want to set it in logArea.

    Here is syntax.

    Java Code:
    mainFrame.updateLog( "Hi "  + "How R u");
    Now i wan to set the Foreground color only on "Hi" text. It is possibel..

  7. #7
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    Basically you can use setForeground() on a label.
    Plz help me

  8. #8
    Niveditha's Avatar
    Niveditha is offline Senior Member
    Join Date
    May 2008
    Posts
    307
    Rep Power
    7

    Default

    Hello Mir,
    Check this link may help yoy to some extent.
    Java Tips - How to add colored text to the document
    To finish sooner, take your own time....
    Nivedithaaaa

  9. #9
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Niveditha View Post
    Hello Mir,
    Check this link may help yoy to some extent.
    Java Tips - How to add colored text to the document
    Thxs Niveditha

  10. #10
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    What you mean foreground color of text? Text color?
    Here i have problem to think how to go with this code.So can you help me..

  11. #11
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    With which code. Please try to explain your questions with more details all the time. How can I know that about which code you are talking.

  12. #12
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    With which code. Please try to explain your questions with more details all the time. How can I know that about which code you are talking.
    Sir i want to change the text colore.I got example from Niveditha
    Java Code:
     Java Tips - How to add colored text to the document
    .And i want to add this code on my exiting code.But i got problem to add this.

    My code extend Thread,so i have a problem.Can i send you code(my code).

  13. #13
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    With which code. Please try to explain your questions with more details all the time. How can I know that about which code you are talking.
    Sir i have no idea how to go with this problem..Plz help me

  14. #14
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    There is no connection with thread and this font color changing. So, only thing you have to do is find the best place(within the thread or not) to make this color change.

  15. #15
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    There is no connection with thread and this font color changing. So, only thing you have to do is find the best place(within the thread or not) to make this color change.
    ok sir ,how i go.I have no idea ,plz tell way to go in right direction..

    plz help me

  16. #16
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    There is no connection with thread and this font color changing. So, only thing you have to do is find the best place(within the thread or not) to make this color change.
    Sir plz tell me..becouse you know i need your help..

  17. #17
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    To help you should explain your question well. Just talking about a code again and again, but not well explanation you put here.

  18. #18
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    To help you should explain your question well. Just talking about a code again and again, but not well explanation you put here.
    Sir i am sending code through PM..Plz check it

  19. #19
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Mir View Post
    Sir i am sending code through PM..Plz check it
    Sir are you geting message or not.I am waiting for your responce..

    Plz help me

  20. #20
    Mir
    Mir is offline Senior Member
    Join Date
    Mar 2008
    Posts
    447
    Rep Power
    7

    Default

    Quote Originally Posted by Eranga View Post
    To help you should explain your question well. Just talking about a code again and again, but not well explanation you put here.
    Sir plz help i send code..throgh PM.So plz help me

Page 1 of 2 12 LastLast

Similar Threads

  1. How to change JDK?
    By mew in forum Eclipse
    Replies: 5
    Last Post: 05-21-2010, 06:21 AM
  2. Replies: 0
    Last Post: 06-25-2008, 11:33 AM
  3. Replies: 0
    Last Post: 05-26-2008, 05:26 PM
  4. How ro change the locale of JVM
    By ravi.ks007@hotmail.com in forum Advanced Java
    Replies: 2
    Last Post: 12-26-2007, 07:17 AM
  5. Is it possible to change the '\n' into ' ' ...
    By johnny7white in forum New To Java
    Replies: 1
    Last Post: 11-15-2007, 03:32 PM

Posting Permissions

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