Quote:
|
Originally Posted by freesoft_2000 Here is what i have been doing Code: public void setcolor()
{
Color Color1 = ColorChooser1.showDialog(fr, "Color Chooser", Color.white);
SimpleAttributeSet sas = new SimpleAttributeSet();
if(Color1 != null)
{
StyleConstants.setBackground(sas, Color1);
sas.addAttribute(HTML.Attribute.BGCOLOR, Color1);
}
} The thing is when i use the above function nothing happens but compiles without any errors. Can anyone please help me out with this problem? |
It compiles fine. It runs fine. The problem - you have nothing assigned to happen when Color1 IS null.
Therefore, what is probably happening is that Color1 is null.
Throw an else in there to pop an error if Color1 is null and see if it fires. If it does, you have to figure out why that is.
HTH