Q:

How to check an empty Double JTextField

I've been working this for 2 days but I can't still figure how to check if the jtextfield is empty (Double not String) before passing it to my database.
I figured it out how to validate String if the field is empty, but I need to put the right code on how to validate Double if the field is empty.
Thanks in advance.
Here's my code:
private void saveButton3ActionPerformed(java.awt.event.ActionEvent evt) {
    String inventcodef = inventCodeField.getText();
    String inventnamef = inventNameField.getText();
    String categ = cmbname.getSelectedItem().toString();
    double inventreorderf = Double.parseDouble(inventReorderField.getText());

    ..............
    if ((inventCodeField.trim().Length()==0) ||       (inventNameField.trim().Length()==0)

A:

To enforce formatting (numeric etc) you can use JFormattedTextField.
To ensure values are not blank see No blanks in JTextField

