public void displayErrorMessage(final String message, final Throwable error)
{
if(mainWindow!=null){
if(SwingUtilities.isEventDispatchThread()){
new ErrorDialog(mainWindow, message, error).open();
}
else{
try{
SwingUtilities.invokeAndWait(new Runnable()
{
@Override
public void run()
{
new ErrorDialog(mainWindow, message, error).open();
}
});
}
catch(Exception e){
log.error("Error mostrant finestra d'error: {}", e.getMessage(), e);