please try to change AlertType to null.
alert = new Alert("Alert YES/NO", "Press YES or NO", null, null);