aToolkit = xMSF.createInstance("com.sun.star.awt.Toolkit");
}
catch(com.sun.star.uno.Exception e) {
throw new StatusException("Could not create 'com.sun.star.awt.Toolkit'.", e);
}
XExtendedToolkit xExtendedToolkit = (XExtendedToolkit)UnoRuntime.queryInterface(XExtendedToolkit.class, aToolkit);
AccessibilityTools accTools = new AccessibilityTools();
XWindow xWindow = (XWindow)UnoRuntime.queryInterface(XWindow.class, xExtendedToolkit.getActiveTopWindow());
XAccessible xRoot = accTools.getAccessibleObject(xWindow);
XTopWindow tw = null;
XAccessibleComponent xAccessibleComponent = null;
int k = xExtendedToolkit.getTopWindowCount();
for (int i=0;i<k;i++) {
try {
XTopWindow tw_temp = xExtendedToolkit.getTopWindow(i);
XAccessible xacc = (XAccessible)UnoRuntime.queryInterface(XAccessible.class, tw_temp);
if (xacc != null) {
System.out.println("Name: " + xacc.getAccessibleContext().getAccessibleName());
if (xacc.getAccessibleContext().getAccessibleName().startsWith("the title")) {
tw = tw_temp;