public static void createErrorDialog(final String title,final String message){
  final Alert alert=new Alert(AlertType.ERROR);
  alert.setTitle(title);
  alert.setContentText(message);
  alert.setHeaderText(null);
  alert.showAndWait();
}

public static void createErrorDialog ( final String title , final String message ) { final Alert alert = new Alert ( AlertType . ERROR ) ; alert . setTitle ( title ) ; alert . setContentText ( message ) ; alert . setHeaderText ( null ) ; alert . showAndWait ( ) ; }
shows an error dialog .
