View Single Post
Old 12-06-2004, 07:38 AM   #2 (permalink)
kaeli69
Registered User
 
kaeli69's Avatar
 
Join Date: Apr 2003
Posts: 30
kaeli69 is an unknown quantity at this point
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
kaeli69 is offline   Reply With Quote