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 MODIFStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started