Create an error message pop up from entity listener

Hi ,
can i create invoke a pop up to the UI front end from the entity listener? if the entity listener detect an error, invoke a pop up the UI with the error message to inform the user