question: private boolean verifyValueInput ( 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 ; }
target:  Verify that the value is correct.