How do i prevent a Dialog from closing after button pressed?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



How do i prevent a Dialog from closing after button pressed?



After i return from the Dialog i want to use the values from the fields from the dialog and create a aobject to return. I do however want to test those values before i go back to the main screen. How do i prevent going back to the main screen when i use the ok button when the values are not ok? (using showandwait)


(DialogController Class)
public ProcedureBerekening processresults()
String oneSs = oneSsField.getText().replace(",",".").trim();
double oneSsDouble = Double.parseDouble(oneSs);
System.out.println(oneSsDouble);
String oneScoop = oneScoopField.getText().trim();
int oneScoopInt = Integer.parseInt(oneScoop);

String totalWeight = totalWeightField.getText().trim();
int totalWeightInt = Integer.parseInt(totalWeight);

String sampleWeight = sampleWeightField.getText().trim();
int sampleWeightInt = Integer.parseInt(sampleWeight);


ProcedureBerekening temp = ProcedureBerekening.createNewProcedureBerekening(oneSsDouble,sampleWeightInt,totalWeightInt,oneScoopInt);
return temp;

(Controller class)
Optional<ButtonType> result = dialog.showAndWait();
if(result.isPresent()&&result.get()==ButtonType.OK)
NewCalculationController controller = fxmlLoader.getController();
ProcedureBerekening newCalculation = controller.processresults();









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

make 2 or more post in bootsrap

Store custom data using WC_Cart add_to_cart() method in Woocommerce 3

Firebase Auth - with Email and Password - Check user already registered