I\'m looking to record keystrokes and mouse positions while I\'m in a browser window on various websites, but I\'m not sure how to do this outside the SWING (or some other GUI)
The support you need is not exposed by Java. It is a fairly simple matter to do this if you have access to the RECORD extension in X, or Win32 on Windows.
Here is a Python project that implements support for both of these platforms: pykeylogger.