pingMenuItem.setOnAction(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
PingManager pingManager = xmppSession.getExtensionManager(PingManager.class);
try {
pingManager.pingServer();
} catch (XmppException e) {
e.printStackTrace();
}
}
});