I wrote this method, because I want to check all of places if textfields, datepicker and radiobuttons are empty when I will press a button, but it doesn't work.
What should I correct in this code, or should I do a method in different way?
public void btn1(ActionEvent event) throws Exception {
if(name.getText().trim().isEmpty() && surname.getText().trim().isEmpty() && pesel.getText().trim().isEmpty() && adres.getText().trim().isEmpty() && email.getText().trim().isEmpty() )
if(dateOfBirth.getValue() == null)
if(sexM.isSelected() || sexF.isSelected() || sexG.isSelected()){
lbl.setText("All of places have to be filled");
} else {
Stage primaryStage = new Stage();
Parent root = FXMLLoader.load(getClass().getResource("\\Step2.fxml"));
Scene scene = new Scene(root);
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
primaryStage.setScene(scene);
primaryStage.show();
}
}
}
}