Keypress Generator

Here is a quick and dirty way to simulate a keypress using the Robot class in Java. If you provide a string to the constructor and call the type() method, each of the characters in the string will be generated as a keypress. The code only supports A-Z and a-z, but could be modified to cover a larger character set.

Generate All Permutations of a String in Java

This is a recursive function to generate all permutations of a string in Java. For example, if “abc” is entered, the code will generate all permutations of length 1 to 3 characters: a, b, c, ab, ac, ba, bc, ca, cb, abc, acb, bac, bca, cab, cba.