Question: I'm trying to implement an alert using scenebuilder, it's working. The only problem is it doesn't wait for the user to start typing anything in
I'm trying to implement an alert using scenebuilder, it's working. The only problem is it doesn't wait for the user to start typing anything in the field before displaying the error message. As soon as I click on add part it displays the Error message before even changing scenes. It does change scenes after I exit click 'ok' on the alert. Any help would be greatly appreciated.
private boolean validateInput(){ try{ double dPrice = 1.00; dPrice = Double.parseDouble(addPartPrice.getText()); } catch (NumberFormatException | NullPointerException nfe){ AlertMessage.errorPart(3, addPartPrice); return false; } try{ int iStock = Integer.parseInt(addPartInventory.getText()); } catch (NumberFormatException | NullPointerException nfe){ return false; } try{ int iMin = Integer.parseInt(addPartMin.getText()); } catch (NumberFormatException | NullPointerException nfe){ return false; } try{ int iMax = Integer.parseInt(addPartMax.getText()); } catch (NumberFormatException | NullPointerException nfe){ return false; } if(!partIsoutSourcedFromCompany){ try{ int iID = Integer.parseInt(addPartSource.getText()); } catch (NumberFormatException | NullPointerException nfe){ return false; } } return addPartName.getText() != null && addPartSource.getText() != null && Integer.parseInt(addPartMin.getText()) >= 0 && Integer.parseInt(addPartMin.getText()) = 0; }
Error adding part SEARCH SEARCH ENT Cannot add part PART NAME UCT NAME INVE INVENT 5 PART 1 Invalid format! DUCT 1 PART 2 OK 5 DUCT 2 PART 3 10 50.5 3 PRODUCT 3 (ADD ADD MODIFY MODIFY DELETE DELETE ADD MODIF
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
