Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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; }image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students also viewed these Databases questions

Question

How is TCP different from UDP?

Answered: 1 week ago