private boolean verifyWidthInput(JComponent input){
  JTextField textField=(JTextField)input;
  String inputString=textField.getText();
  try {
    float width=Float.parseFloat(inputString);
    if (width <= 0.0) {
      textField.setForeground(Color.RED);
      return false;
    }
  }
 catch (  NumberFormatException e) {
    textField.setForeground(Color.RED);
    return false;
  }
  textField.setForeground(Color.BLACK);
  return true;
}

private boolean verifyWidthInput ( JComponent input ) { JTextField textField = ( JTextField ) input ; String inputString = textField . getText ( ) ; try { float width = Float . parseFloat ( inputString ) ; if ( width <= 0.0 ) { textField . setForeground ( Color . RED ) ; return false ; } } catch ( NumberFormatException e ) { textField . setForeground ( Color . RED ) ; return false ; } textField . setForeground ( Color . BLACK ) ; return true ; }
verify that the value is correct .
