Hi,

I'm working on a program that can generate random passwords. I've got a JComboBox in which the user can choose the PasswordLength. Then, when the user clicks on the Generate-button, a random password is generated.

I've got 3 vectors:

The first vector contains digits from 0 to 9.
The second vector contains the alphabet in lower case.
The third vector contains the alphabet in upper case.

When the user presses the Generate-button, the method GeneratePassword() is invoked. But I don't exactly know how to write that method.

For every place in the password, the program must choose a random vector out of the three vectors mentioned above, to pick a value from.. and then choose a random value. For the next place in the password, this operation must be repeated.

The method GeneratePassword() is empty now:

Code:
     public String GeneratePassword() {
          for(int i = 0; i < Integer.parseInt((String)cPasswordLength.getSelectedItem()); i++) {
          }
     }
Using a for-statement, the method should go to the next place in the password to be generated.

So, anyone wants to help?