Search code examples
javauser-interfaceanalyticstracking

How to track a Java app's usage without rewriting its source code?


I would like to track clicks to JButtons, log page views, see time spent on a specific page, etc...

Ideally, I would just like to add a one liner in the constructor or something along the lines of Analytics.startTracking()

Is there such a framework that already does this?

If not, how would you go about implementing one?


Solution

  • I don't know of any framework that does this. You can use Toolkit.addAWTEventListener to capture all AWT events and use that information.