Element focus
This example will periodically (every 1.5 seconds) display the element that has focus.
UIAutomation automation = UIAutomation.getInstance();
do {
this.rest();
try {
Element elementFocus = automation.getFocusedElement();
logger.info("From focus = " + elementFocus.getName());
} catch (Exception ex) {
logger.info(ex.getStackTrace());
}
} while (true);
Real World Examples
These applications have example code to show then working, in the mmarquee.demo folder / namespace.