A password generator that can be used to just make yourself a quick randomized password, save it on your computer somewhere, etc. Good if you don't want to create one I suppose.Code:import javax.swing.JOptionPane; public class Password { static char[] chars = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0' }; public static void main(String[] args) { int l = getLength(); System.out.println(getPassword(l)); } private static String getPassword(int l) { int x1 = chars.length; String t = ""; for(int x=0; x<l; x++) t += (0 + (int) (Math.random() * 2)) > 0 ? Character.toUpperCase( chars[(int) (Math.random() * x1)]): chars[(int) (Math.random() * x1)]; return t; } private static void showDialog(String s) { JOptionPane.showMessageDialog(null, s); } private static int getLength() { try{ return Integer.parseInt( JOptionPane.showInputDialog(null, "Enter the length of the password!")); }catch(NumberFormatException ex) { showDialog("Enter a number!"); } return getLength(); } }