public void actionPerformed(ActionEvent e){
  color=chooser.getColor();
  setPreviewColor(color);
  isOK=true;
}

public void actionPerformed ( ActionEvent e ) { color = chooser . getColor ( ) ; setPreviewColor ( color ) ; isOK = true ; }
actionlistener interface . sets the color from the jcolorchooser .
