Doing a fun project for my school club and want to spice up my presentation a little bit. I know what I want but no idea how to make it happen.
I want a line that reads: "Your success rate for energy consumption is (value)%."
I already have the source for the value but I need help with the display.
What I am looking to do is have the font color for the (value) be dynamic based on the value itself. So, if the value is <0 font color=red, if value is =0, font color is yellow, if value is >0 font color is green.
Not being a web designer/code guru I'm not sure how to make this happen in HTML. I also read through a few similar types of questions but the school won't let me upload any JavaScript files but I think I can link to the ajax.googleapis.com site just fine if it's determined I need to use JavaScript.
Any help is appreciated.
String color = "red"; String msg = "<html>Your success rate for energy consumption is <font color=" + color + ">" + value + "</font>%.</html>". You can display this string in a JLabel or whatever. Where do you want to display this sort of string?