What you're trying to do with this application depends very much on the operating system you want to support. And if I understand your plans correctly it would be not the best idea to use Java for this kind of application regardless of the operating system. Although it's no problem to trace all events within an application in Java it won't be possible to trace the events of all running tasks or applications with pure Java. You'd be better of with another language which allows you easier access to native OS resources at least for that part where you want to intercept user events. I think most popular operating systems today offer the best support for C/C++ if you want to access low level details of your system. Then again your application won't be very portable between operating systems.
Anyway it's hard to give you really good advices without knowing more about your ideas regarding this application. And besides these technical issues you should at least think about if it's very nice to spy on other users