Results 1 to 4 of 4
Thread: How to change string Color
- 01-05-2009, 06:26 PM #1
Member
- Join Date
- Sep 2008
- Posts
- 32
- Rep Power
- 0
How to change string Color
Hello Experts,
I am storing some vaule in string.I want if getOptionValue() == 1 then output comes into red color.
String Priority = "";
Priot.set( ( new Variant( Frame134.getOptionValue() == 1 ) ) );
if( Frame134.getOptionValue() == 1 )
{
Priority = "Highest Priority";
}
Priot.set( ( new Variant( Frame134.getOptionValue() == 2 ) ) );
if( Frame134.getOptionValue() == 2 )
{
Priority = "A-Today";
}
Priot.set( ( new Variant( Frame134.getOptionValue() == 3 ) ) );
if( Frame134.getOptionValue() == 3 )
{
Priority = "B-This Week";
}
Priot.set( ( new Variant( Frame134.getOptionValue() == 4 ) ) );
if( Frame134.getOptionValue() == 4 )
{
Priority = "C-Next Week";
}
Please suggest me how to do that.
Thanks.
- 01-05-2009, 08:05 PM #2
String doesn't have a color.
> then output comes into red color.
Output where? Console? GUI?
Please go through this web page:
How To Ask Questions The Smart Way
db
- 01-05-2009, 08:12 PM #3
What you are asking is, "How do I display text in different colors?" The answer depends on how you are displaying the text. If you are creating a Swing GUI, then you could use JLabel or JTextfield and set the appropriate color attributes of those controls.
- 01-06-2009, 04:27 AM #4
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Similar Threads
-
How to change color of JTable row having a particular value
By johnt in forum AWT / SwingReplies: 6Last Post: 05-14-2011, 06:48 AM -
Change the color in my program
By carl in forum New To JavaReplies: 5Last Post: 04-03-2009, 12:20 PM -
JButton onClick change color background
By behrk2 in forum AWT / SwingReplies: 6Last Post: 07-09-2008, 04:54 PM -
How to change backgrnd color of link(active)
By Captainz in forum New To JavaReplies: 1Last Post: 05-02-2008, 11:10 PM -
How to change TXT color Onclick
By dave700800 in forum New To JavaReplies: 1Last Post: 12-08-2007, 01:39 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks