private boolean verifyXInput(JComponent input){
  JTextField textField=(JTextField)input;
  String inputString=textField.getText();
  try {
    Double.parseDouble(inputString);
  }
 catch (  NumberFormatException e) {
    textField.setForeground(Color.RED);
    return false;
  }
  textField.setForeground(Color.BLACK);
  return true;
}

private boolean verifyXInput ( JComponent input ) { JTextField textField = ( JTextField ) input ; String inputString = textField . getText ( ) ; try { Double . parseDouble ( inputString ) ; } catch ( NumberFormatException e ) { textField . setForeground ( Color . RED ) ; return false ; } textField . setForeground ( Color . BLACK ) ; return true ; }
verify that the x - value is correct .
