I have no knowledge of Java. I am working on an idea I have for a program and the main feature of it is being able to detect what object the user is clicking on a desktop application. The programs I want to track are the Microsoft Office suite and what I want to know is can Java be used to identify what the user has clicked and run a routine based on that, such as an on screen message or audio message. For example, if the user clicks on the Home Tab in Excel, and then clicks on the Format Painter button - I want to be able to register these steps (Hometab > Format Painter) and show messages etc after each click.

This must be possible somehow because I've used Adobe Captivate to record tutorials on Microsoft Office and it automatically produces captions based on what you click - for example if I click on the home tab in Excel, it automatically inserts a caption that says "Click on Home Tab".

At the moment I only want to know if it can be done or not - I'm not going to try and develop this myself, so I don't need any code etc posted here.

If Java is not the programming language most suited for this, I would appreciate ideas on what could be used so I can post in those forums like I have here.

Many thanks!