if((isChecked && !toBePressed) || (!isChecked && toBePressed)){
XAccessibleAction oAction = (XAccessibleAction)
UnoRuntime.queryInterface(XAccessibleAction.class, oButton);
try{
// "click" the button
oAction.doAccessibleAction(0);
return true;
} catch (com.sun.star.lang.IndexOutOfBoundsException e) {
System.out.println("Could not do accessible action with '"
+ buttonName + "'" + e.toString());
return false;