Первый JOptionPane.showInputDialog("Password?");
бесполезен, он просто покажет диалоговое окно, для которого значение игнорируется, во-вторых geheugen = JOptionPane.INPUT_VALUE_PROPERTY;
указывает на константу, он не получает набранный пароль, я пришел с попыткой сопоставить ваши потребности, я надеюсь, это поможет:
public void kleurFrame() {
initComponents();
String geheugen = null ;
String password = "Hay"; // even if it is a bad practice to hardcode a password !!
while (!password.equals(geheugen)) {
geheugen = JOptionPane.showInputDialog("Password?");
}
// once the blocking loop ended, that means
// the password is correct and you can exit
// the dialog and continue normally
JOptionPane.showMessageDialog(null/*or the calling component*/,"the password is correct, now you can continue",
"this is just an example",JOptionPane.INFORMATION_MESSAGE);
}