JavaScript errors on this page are down to Geocities as far as I know - sorry.

Simple java input capture and playback tool

The attached java program can be used to capture input to a Swing program and replay it later. It needs the Java 1.3 Robot and AWTEventListener classes.

A few minor points...

  • Although it would be possible to capture mouse input, I have chosen not to (for reasons mentioned in the code).
  • The output is captured in a java file, Playback.java, which you must compile externally. You could easily capture the output in a script instead and have a Player program that executed the script - I prefer to be able to edit the java code.
  • I've put the code in the default package - which I believe is a sensible place for this sort of utility. Seeing as the rest of you all follow Sun's package standards, the default package is safe for me to use!
  • Here is the javadoc, the source code, and the byte code.

    Graham Jenkins.