public Color chooseColor(int type,Color presetColor,Color secondaryColor,String name,String text){
  setLocationRelativeTo(getParent());
  returnNewColor=false;
  setTitle("Change Color: " + name);
  this.type=type;
  this.secondaryColor=secondaryColor;
  preview.setText(text);
  chooser.setColor(presetColor);
  setVisible(true);
  if (returnNewColor) {
    return chooser.getColor();
  }
  return presetColor;
}

public Color chooseColor ( int type , Color presetColor , Color secondaryColor , String name , String text ) { setLocationRelativeTo ( getParent ( ) ) ; returnNewColor = false ; setTitle ( "Change Color: " + name ) ; this . type = type ; this . secondaryColor = secondaryColor ; preview . setText ( text ) ; chooser . setColor ( presetColor ) ; setVisible ( true ) ; if ( returnNewColor ) { return chooser . getColor ( ) ; } return presetColor ; }
let the user choose a color and return that color .
