public void showErrorMessageBox(XWindowPeer _xWindowPeer, String _sTitle, String _sMessage){
try {
Object oToolkit = m_xComponentContext.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit", m_xComponentContext);
XMessageBoxFactory xMessageBoxFactory = (XMessageBoxFactory) UnoRuntime.queryInterface(XMessageBoxFactory.class, oToolkit);
Rectangle aRectangle = new Rectangle();
XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox(_xWindowPeer, aRectangle, "errorbox", com.sun.star.awt.MessageBoxButtons.BUTTONS_OK, _sTitle, _sMessage);
XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xMessageBox);
if (xMessageBox != null){
short nResult = xMessageBox.execute();
xComponent.dispose();
}
} catch (com.sun.star.uno.Exception ex) {
ex.printStackTrace(System.out);
}}