private boolean verifyValueRangeUpperBoundInput(JComponent input){
  JTextField textField=(JTextField)input;
  String inputString=textField.getText();
  try {
    double valueUpperBound;
    if (inputString.startsWith("-")) {
      valueUpperBound=Double.parseDouble(inputString.substring(1));
      valueUpperBound=-valueUpperBound;
    }
 else {
      valueUpperBound=Double.parseDouble(inputString);
    }
  }
 catch (  NumberFormatException e) {
    textField.setForeground(Color.RED);
    return false;
  }
  textField.setForeground(Color.BLACK);
  return true;
}

private boolean verifyValueRangeUpperBoundInput ( JComponent input ) { JTextField textField = ( JTextField ) input ; String inputString = textField . getText ( ) ; try { double valueUpperBound ; if ( inputString . startsWith ( "-" ) ) { valueUpperBound = Double . parseDouble ( inputString . substring ( 1 ) ) ; valueUpperBound = - valueUpperBound ; } else { valueUpperBound = Double . parseDouble ( inputString ) ; } } catch ( NumberFormatException e ) { textField . setForeground ( Color . RED ) ; return false ; } textField . setForeground ( Color . BLACK ) ; return true ; }
verify that the height value is correct .
