When you say "didn't work", exactly what does that mean? I can see a few things which might be problems, but since I don't know what the actual problem is there is no point in guessing. Have a look at this page: ItDoesntWorkIsUseless (<== click that link) for more detail on how to explain your problem.
Hi @Paul Clapham , i have edited my post . My actual question is : "how to commit the changes (set through setCssText(string) ) so that the new property value of color would be written into the css file ?"
An input stream won't update a file. To write to a file you need to use a FileWriter. Maybe your css api has methods to open a file for editing. If not then you need to create a new file and copy the contents from the first to the new one making any required amendments along the way.
In practice if you want to update a text file, any text file at all, the way to do that is to make a new copy of the old file. If this product allows you to update the CSS at all, that is how it's going to work.
I am able to set the values for properties using the method "setCssText(string)" and i have written code to extract the the content from "styleSheet" object initialized previously and written that into new file. Its working properly now.