Results 21 to 40 of 40
Thread: change Text Colore
- 07-11-2008, 06:34 AM #21
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 07:11 AM #22
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 08:29 AM #23
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 08:56 AM #24
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 09:45 AM #25
Ok Mir..
So your problem is that your code extends thread and the example code extends JTextPane and you cant extend two classes rite?
Simple write a different class that extends JTextPane and that class should have your method/code of changing text color. Create an instance of this class in your original class and call that method with the help of some parameters if required...To finish sooner, take your own time....
Nivedithaaaa
- 07-11-2008, 11:09 AM #26
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 11:51 AM #27
Yes exactly!!! that is what i meant....
To finish sooner, take your own time....
Nivedithaaaa
- 07-11-2008, 11:53 AM #28
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Easiest place to do this is appendText() of the LogArea class. Basically before append the text, do all formatting. As Niveditha says, if you involve with the thread it can be little hard/complex. Basically check the lat place before adding text to the GUI.
- 07-11-2008, 11:58 AM #29
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 12:05 PM #30
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Check you LogArea class, and try to identify the place where you write logs.
- 07-11-2008, 12:12 PM #31
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
Sir i am not writing a log in Log Class.Here is log class,can you tell where i put the code..
Java Code:public class LogArea extends TextArea { static LogArea logArea; public LogArea(int rows, int columns) { super(rows, columns); setEditable(false); } public synchronized void appendText(String str) { super.appendText(str); }
- 07-11-2008, 12:15 PM #32
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Now you know how to change colors on the text right?
- 07-11-2008, 12:19 PM #33
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-11-2008, 12:22 PM #34
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Ok, can you find the method which is your application write text to the text area of the GUI(basically the interface you have)?
- 07-11-2008, 12:26 PM #35
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-14-2008, 04:07 AM #36
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
ok, before update the text, do the formatting. Because in that case you don't need to deal with threads and so on.
- 07-14-2008, 06:26 AM #37
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 07-14-2008, 06:48 AM #38
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
I have no time to write codes. I gave you suggestions. Trying it or not is your decision. I don't care about that.
- 07-14-2008, 07:11 AM #39
Senior Member
- Join Date
- Mar 2008
- Posts
- 447
- Rep Power
- 6
- 03-26-2009, 04:44 PM #40
I have read this thread and I am lost, I am looking to change the output text colour on my app
I have three outputs
Underweight - I want orange
OK I want Green
Overweight I want red
I want the textfield to be black
I have tried to make sense of the links given here but I cant, anyone give me a little more information please?
Thanks in advance.
Similar Threads
-
How to change JDK?
By mew in forum EclipseReplies: 5Last Post: 05-21-2010, 05:21 AM -
How to use TextAttribute class to change color and font of a text
By Java Tip in forum java.awtReplies: 0Last Post: 06-25-2008, 10:33 AM -
Unsupported Content-Type: text/html Supported ones are: [text/xml]
By luislopezco in forum Advanced JavaReplies: 0Last Post: 05-26-2008, 04:26 PM -
How ro change the locale of JVM
By ravi.ks007@hotmail.com in forum Advanced JavaReplies: 2Last Post: 12-26-2007, 06:17 AM -
Is it possible to change the '\n' into ' ' ...
By johnny7white in forum New To JavaReplies: 1Last Post: 11-15-2007, 02:32 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks