private boolean betweenZeroAndOne(final String paramName,final double val){
  if ((val < 0) || (val > 1)) {
    JOptionPane.showMessageDialog(null,paramName + "should be between 0 and 1","Warning!",JOptionPane.WARNING_MESSAGE);
    return false;
  }
  return true;
}

private boolean betweenZeroAndOne ( final String paramName , final double val ) { if ( ( val < 0 ) || ( val > 1 ) ) { JOptionPane . showMessageDialog ( null , paramName + "should be between 0 and 1" , "Warning!" , JOptionPane . WARNING_MESSAGE ) ; return false ; } return true ; }
helper method to check that a value is between 0 and 1 and display a warning if not .
