public void showWarningBox(String sTitle, String sMessage){
try {
Object oToolkit = m_xContext.getServiceManager().createInstanceWithContext("com.sun.star.awt.Toolkit", m_xContext);
XToolkit xToolkit = (XToolkit) UnoRuntime.queryInterface(XToolkit.class, oToolkit);
XMessageBoxFactory xMessageBoxFactory = (XMessageBoxFactory)UnoRuntime.queryInterface(XMessageBoxFactory.class, oToolkit);
if ( m_xFrame != null && xToolkit != null ) {
WindowDescriptor aDescriptor = new WindowDescriptor();
aDescriptor.Type = WindowClass.MODALTOP;
aDescriptor.ParentIndex = -1;
aDescriptor.Parent = (XWindowPeer)UnoRuntime.queryInterface(XWindowPeer.class, m_xFrame.getContainerWindow());
XWindowPeer xPeer = xToolkit.createWindow( aDescriptor );
if ( null != xPeer ) {
Rectangle aRectangle = new Rectangle();
XMessageBox xMessageBox = xMessageBoxFactory.createMessageBox( xPeer, aRectangle, "warningbox", com.sun.star.awt.MessageBoxButtons.BUTTONS_OK_CANCEL, sTitle, sMessage);
if (xMessageBox != null){
m_sMessageValue = xMessageBox.execute();
XComponent xComponent = (XComponent) UnoRuntime.queryInterface(XComponent.class, xMessageBox);
if(xComponent != null)
xComponent.dispose();