Why reinvent the wheel? RandomStringUtils from Apache Commons has functions to which you can specify the character set from which characters are generated. You can take what you need to your app:
http://kickjava.com/src/org/apache/commons/lang/RandomStringUtils.java.htm